* [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
[not found] <20230721011303.4303-1-xujianghui@cdjrlc.com>
@ 2023-07-21 1:14 ` sunran001
2023-08-22 23:01 ` Stephen Boyd
0 siblings, 1 reply; 4+ messages in thread
From: sunran001 @ 2023-07-21 1:14 UTC (permalink / raw)
To: nm, kristo, ssantosh, mturquette, sboyd; +Cc: linux-kernel, linux-clk
./drivers/clk/keystone/sci-clk.c:390:8-14: ERROR: application of sizeof
to pointer
Signed-off-by: Ran Sun <sunran001@208suo.com>
---
drivers/clk/keystone/sci-clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/keystone/sci-clk.c
b/drivers/clk/keystone/sci-clk.c
index 6c1df4f11536..2c68c1e09d1f 100644
--- a/drivers/clk/keystone/sci-clk.c
+++ b/drivers/clk/keystone/sci-clk.c
@@ -389,7 +389,7 @@ static struct clk_hw *sci_clk_get(struct
of_phandle_args *clkspec, void *data)
key.clk_id = clkspec->args[1];
clk = bsearch(&key, provider->clocks, provider->num_clocks,
- sizeof(clk), _cmp_sci_clk);
+ sizeof(**clk), _cmp_sci_clk);
if (!clk)
return ERR_PTR(-ENODEV);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
2023-07-21 1:14 ` [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer sunran001
@ 2023-08-22 23:01 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2023-08-22 23:01 UTC (permalink / raw)
To: kristo, mturquette, nm, ssantosh, sunran001; +Cc: linux-kernel, linux-clk
Quoting sunran001@208suo.com (2023-07-20 18:14:19)
> ./drivers/clk/keystone/sci-clk.c:390:8-14: ERROR: application of sizeof
> to pointer
>
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
> drivers/clk/keystone/sci-clk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/keystone/sci-clk.c
> b/drivers/clk/keystone/sci-clk.c
> index 6c1df4f11536..2c68c1e09d1f 100644
> --- a/drivers/clk/keystone/sci-clk.c
> +++ b/drivers/clk/keystone/sci-clk.c
> @@ -389,7 +389,7 @@ static struct clk_hw *sci_clk_get(struct
> of_phandle_args *clkspec, void *data)
> key.clk_id = clkspec->args[1];
>
> clk = bsearch(&key, provider->clocks, provider->num_clocks,
Huh? I see 'provider->clocks' is struct sci_clk_provider::clocks which
is of type 'struct sci_clk **'. It looks like each element in the array
is a 'struct sci_clk *', so if we want to silence the coccinelle warning
perhaps this should change to sizeof(*clk). Certainly we don't want to
change it to be the sizeof(struct sci_clk) though. Does changing the
sizeof() to deref the pointer work to silence the error?
> - sizeof(clk), _cmp_sci_clk);
> + sizeof(**clk), _cmp_sci_clk);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
2023-07-20 8:42 ` sunran001
@ 2023-07-20 13:55 ` Nishanth Menon
0 siblings, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2023-07-20 13:55 UTC (permalink / raw)
To: sunran001; +Cc: kristo, ssantosh, mturquette, sboyd, linux-kernel, linux-clk
On 16:42-20230720, sunran001@208suo.com wrote:
> The coccinelle check report:
> ./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of
> sizeof to pointer
-ECONFUSED -> the report does'nt match the file here. did I miss
something?
>
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
> drivers/clk/keystone/sci-clk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sci-clk.c
> index 6c1df4f11536..2c68c1e09d1f 100644
> --- a/drivers/clk/keystone/sci-clk.c
> +++ b/drivers/clk/keystone/sci-clk.c
> @@ -389,7 +389,7 @@ static struct clk_hw *sci_clk_get(struct of_phandle_args
> *clkspec, void *data)
> key.clk_id = clkspec->args[1];
>
> clk = bsearch(&key, provider->clocks, provider->num_clocks,
> - sizeof(clk), _cmp_sci_clk);
> + sizeof(**clk), _cmp_sci_clk);
>
> if (!clk)
> return ERR_PTR(-ENODEV);
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
[not found] <20230720074906.3373-1-xujianghui@cdjrlc.com>
@ 2023-07-20 8:42 ` sunran001
2023-07-20 13:55 ` Nishanth Menon
0 siblings, 1 reply; 4+ messages in thread
From: sunran001 @ 2023-07-20 8:42 UTC (permalink / raw)
To: nm, kristo, ssantosh, mturquette, sboyd; +Cc: linux-kernel, linux-clk
The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of
sizeof to pointer
Signed-off-by: Ran Sun <sunran001@208suo.com>
---
drivers/clk/keystone/sci-clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/keystone/sci-clk.c
b/drivers/clk/keystone/sci-clk.c
index 6c1df4f11536..2c68c1e09d1f 100644
--- a/drivers/clk/keystone/sci-clk.c
+++ b/drivers/clk/keystone/sci-clk.c
@@ -389,7 +389,7 @@ static struct clk_hw *sci_clk_get(struct
of_phandle_args *clkspec, void *data)
key.clk_id = clkspec->args[1];
clk = bsearch(&key, provider->clocks, provider->num_clocks,
- sizeof(clk), _cmp_sci_clk);
+ sizeof(**clk), _cmp_sci_clk);
if (!clk)
return ERR_PTR(-ENODEV);
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-22 23:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230721011303.4303-1-xujianghui@cdjrlc.com>
2023-07-21 1:14 ` [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer sunran001
2023-08-22 23:01 ` Stephen Boyd
[not found] <20230720074906.3373-1-xujianghui@cdjrlc.com>
2023-07-20 8:42 ` sunran001
2023-07-20 13:55 ` Nishanth Menon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.