devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Long <thisisryanlong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Ryan Long <ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH] fdt_rw.c: Fix Unchecked return value error
Date: Tue,  2 Mar 2021 14:58:19 -0500	[thread overview]
Message-ID: <1614715099-23657-1-git-send-email-ryan.long@oarcorp.com> (raw)

Fixed "Unchecked return value" error, by adding "(void)" in front of the
function call.

When Coverity Scan was ran on some of your code, a "Unchecked return value"
error was found at line 352 in fdt_rw.c. For similar errors that we received
for RTEMS, we created a macro that will assert the value returned and "use" the
return value with (void).

Signed-off-by: Ryan Long <ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
---
 cpukit/dtc/libfdt/fdt_rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/dtc/libfdt/fdt_rw.c b/cpukit/dtc/libfdt/fdt_rw.c
index 1385425..cdae5dd 100644
--- a/cpukit/dtc/libfdt/fdt_rw.c
+++ b/cpukit/dtc/libfdt/fdt_rw.c
@@ -348,7 +348,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
 		return offset;
 
 	/* Try to place the new node after the parent's properties */
-	fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+	(void) fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
 	do {
 		offset = nextoffset;
 		tag = fdt_next_tag(fdt, offset, &nextoffset);
-- 
1.8.3.1


             reply	other threads:[~2021-03-02 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 19:58 Ryan Long [this message]
     [not found] ` <1614715099-23657-1-git-send-email-ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
2021-03-09  3:52   ` [PATCH] fdt_rw.c: Fix Unchecked return value error David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2021-03-01 22:24 [PATCH] Unchecked return value error in fdt_rw.c Ryan Long
     [not found] ` <1614637450-4972-1-git-send-email-ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
2021-03-01 22:24   ` [PATCH] fdt_rw.c: Fix Unchecked return value error Ryan Long
     [not found]     ` <1614637450-4972-2-git-send-email-ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
2021-03-02  2:26       ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1614715099-23657-1-git-send-email-ryan.long@oarcorp.com \
    --to=thisisryanlong-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).