Skip to contentSkip to conversation

clk: keystone: sci-clk: fix application of sizeof to pointer

PATCH In review [email protected] 2 participants 2 messages Jul 20, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 clk: keystone: sci-clk: fix application of sizeof to pointer

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application of sizeof to pointer

---
 drivers/clk/keystone/sci-clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/keystone/sci-clk.c +1 -1
index 6c1df4f11536..2c68c1e09d1f 100644
@@ -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);
maintainer
#2 lore raw
Quoted 3 lines · On 16:42-20230720, [email protected] 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?

Quoted 20 lines
---
 drivers/clk/keystone/sci-clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/keystone/sci-clk.c +1 -1
index 6c1df4f11536..2c68c1e09d1f 100644
@@ -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);

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D