devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Ryan Long <thisisryanlong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Ryan Long <ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH] fdt_rw.c: Fix Unchecked return value error
Date: Tue, 9 Mar 2021 14:52:14 +1100	[thread overview]
Message-ID: <YEbw7ppxR9rwFA2o@yekko.fritz.box> (raw)
In-Reply-To: <1614715099-23657-1-git-send-email-ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

On Tue, Mar 02, 2021 at 02:58:19PM -0500, Ryan Long wrote:
> 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>

It's weird that the Coverity Scan on dtc upstream didn't pick this
up.  I thought maybe it did at some point and I just marked it as a
false positive, but I looked through and I couldn't seem to find it at
all (though the Coverity UI is pretty confusing, so maybe I just
missed it).

I've taken a slightly different approach to squashing this upstream,
so I haven't applied this as is.

> ---
>  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);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-03-09  3:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 19:58 [PATCH] fdt_rw.c: Fix Unchecked return value error Ryan Long
     [not found] ` <1614715099-23657-1-git-send-email-ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org>
2021-03-09  3:52   ` David Gibson [this message]
  -- 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=YEbw7ppxR9rwFA2o@yekko.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ryan.long-lGxtRh3/QYtBDgjK7y7TUQ@public.gmane.org \
    --cc=thisisryanlong-Re5JQEeQqe8AvxtiuMwx3w@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).