[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d15a80a2-4a32-4475-3044-33b8e8696405@gmail.com>
Date: Wed, 10 Apr 2019 22:06:59 -0700
From: Frank Rowand <frowand.list@...il.com>
To: xiaojiangfeng <xiaojiangfeng@...wei.com>, robh+dt@...nel.org,
robh@...nel.org, grant.likely@...retlab.ca
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of: fix expression using sizeof(void)
On 4/10/19 6:47 PM, xiaojiangfeng wrote:
> problem detected by sparse:
> drivers/of/fdt.c:1094:34: warning: expression using sizeof(void)
>
> Signed-off-by: xiaojiangfeng <xiaojiangfeng@...wei.com>
> ---
> drivers/of/fdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 4734223..75c6c55 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1091,7 +1091,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> /* Retrieve command line */
> p = of_get_flat_dt_prop(node, "bootargs", &l);
> if (p != NULL && l > 0)
> - strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
> + strlcpy(data, p, COMMAND_LINE_SIZE);
>
> /*
> * CONFIG_CMDLINE is meant to be a default in case nothing else
>
The fuller discussion is in the thread where you first attempted to fix an
issue with the line of code and I reported a sparse error against this line.
After digging deeper, your first patch is valid, removing min() here is not
the correct approach. I will add my Reviewed-by to the first patch and I
will pursue the sparse warning separately.
Thanks,
Frank
Powered by blists - more mailing lists