linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: Matt Fleming
	<matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] efi: simply the fdt_find_uefi_params
Date: Mon, 22 Aug 2016 11:01:47 +0100	[thread overview]
Message-ID: <20160822100147.GA29671@leverpostej> (raw)
In-Reply-To: <1471852761-9913-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

On Mon, Aug 22, 2016 at 03:59:21PM +0800, Shawn Lin wrote:
> Remove the check of node as it should never be
> less then zero dut to its tupe is unsigned long.
> 
> Signed-off-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
> 
>  drivers/firmware/efi/efi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 5a2631a..96261ce 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -656,11 +656,8 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname,
>  			continue;
>  		}
>  
> -		if (subnode) {
> +		if (subnode)
>  			node = of_get_flat_dt_subnode_by_name(node, subnode);
> -			if (node < 0)
> -				return 0;
> -		}

This isn't right, given of_get_flat_dt_subnode_by_name return a (signed)
int, and can return negative values (e.g. -FDT_ERR_BADPATH).

Other core parts of the flat DT code (including libfdt) use an int to
store the node offset, so I believe it should be fine to do the same
here instead.

i.e. we should make the node parameter an int.

Thanks,
Mark.

>  
>  		return __find_uefi_params(node, info, dt_params[i].params);
>  	}
> -- 
> 2.3.7
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-efi" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      parent reply	other threads:[~2016-08-22 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22  7:59 [PATCH] efi: simply the fdt_find_uefi_params Shawn Lin
     [not found] ` <1471852761-9913-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-22 10:01   ` Mark Rutland [this message]

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=20160822100147.GA29671@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=shawn.lin-TNX95d0MmH7DzftRWevZcw@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 NNTP newsgroup(s).