[PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer

sunran001@208suo.com posted 1 patch 2 years, 1 month ago
There is a newer version of this series
drivers/clk/keystone/sci-clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
Posted by sunran001@208suo.com 2 years, 1 month ago
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);
Re: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
Posted by Nishanth Menon 2 years, 1 month ago
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