2022-02-09 23:26:06

by kernel test robot

[permalink] [raw]
Subject: [PATCH] net: dsa: qca8k: fix noderef.cocci warnings

From: kernel test robot <[email protected]>

drivers/net/dsa/qca8k.c:422:37-43: ERROR: application of sizeof to pointer

sizeof when applied to a pointer typed expression gives the size of
the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Fixes: 90386223f44e ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
CC: Ansuel Smith <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 10207e3a840b47b5eae573486a88fb6e29884f77
commit: 90386223f44e2a751d7e9e9ac8f78ea33358a891 [2955/4656] net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet
:::::: branch date: 16 hours ago
:::::: commit date: 7 days ago

qca8k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -419,7 +419,7 @@ qca8k_regmap_read(void *ctx, uint32_t re
u16 r1, r2, page;
int ret;

- if (!qca8k_read_eth(priv, reg, val, sizeof(val)))
+ if (!qca8k_read_eth(priv, reg, val, sizeof(*val)))
return 0;

qca8k_split_addr(reg, &r1, &r2, &page);


2022-02-10 03:38:49

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] net: dsa: qca8k: fix noderef.cocci warnings



On 2/9/2022 2:13 PM, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> drivers/net/dsa/qca8k.c:422:37-43: ERROR: application of sizeof to pointer
>
> sizeof when applied to a pointer typed expression gives the size of
> the pointer
>
> Generated by: scripts/coccinelle/misc/noderef.cocci
>
> Fixes: 90386223f44e ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
> CC: Ansuel Smith <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian

2022-02-11 08:54:07

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH] net: dsa: qca8k: fix noderef.cocci warnings

On Wed, 9 Feb 2022 19:30:48 -0800 Florian Fainelli wrote:
> On 2/9/2022 2:13 PM, kernel test robot wrote:
> > From: kernel test robot <[email protected]>
> >
> > drivers/net/dsa/qca8k.c:422:37-43: ERROR: application of sizeof to pointer
> >
> > sizeof when applied to a pointer typed expression gives the size of
> > the pointer
> >
> > Generated by: scripts/coccinelle/misc/noderef.cocci
> >
> > Fixes: 90386223f44e ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
> > CC: Ansuel Smith <[email protected]>
> > Reported-by: kernel test robot <[email protected]>
> > Signed-off-by: kernel test robot <[email protected]>
>
> > qca8k.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)

kbuild folks, would it be easy to switch to including full path here?
It seems like our CI expects that and ignores this patch.

> Reviewed-by: Florian Fainelli <[email protected]>

Applied, thanks!

2022-02-11 09:22:56

by Chen, Rong A

[permalink] [raw]
Subject: Re: [kbuild-all] Re: [PATCH] net: dsa: qca8k: fix noderef.cocci warnings



On 2/11/2022 2:59 AM, Jakub Kicinski wrote:
> On Wed, 9 Feb 2022 19:30:48 -0800 Florian Fainelli wrote:
>> On 2/9/2022 2:13 PM, kernel test robot wrote:
>>> From: kernel test robot <[email protected]>
>>>
>>> drivers/net/dsa/qca8k.c:422:37-43: ERROR: application of sizeof to pointer
>>>
>>> sizeof when applied to a pointer typed expression gives the size of
>>> the pointer
>>>
>>> Generated by: scripts/coccinelle/misc/noderef.cocci
>>>
>>> Fixes: 90386223f44e ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet")
>>> CC: Ansuel Smith <[email protected]>
>>> Reported-by: kernel test robot <[email protected]>
>>> Signed-off-by: kernel test robot <[email protected]>
>>
>>> qca8k.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> kbuild folks, would it be easy to switch to including full path here?
> It seems like our CI expects that and ignores this patch.

Hi Jakub,

Thanks for the advice, will change it.

Best Regards,
Rong Chen

>
>> Reviewed-by: Florian Fainelli <[email protected]>
>
> Applied, thanks!
> _______________________________________________
> kbuild-all mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>