Skip to contentSkip to conversation

Fix application of sizeof to pointer

PATCH New [email protected] 1 participant 1 message Oct 12, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix application of sizeof to pointer

From: David Yang <[email protected]>

The coccinelle check report:
"./drivers/clk/keystone/sci-clk.c:398:8-14:
ERROR: application of sizeof to pointer"
Using the "sizeof(*clk)" to fix it.

---
 drivers/clk/keystone/sci-clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/keystone/sci-clk.c +1 -1
index 7e1b136e71ae..010a61a2549c 100644
@@ -395,7 +395,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 · 1 line
2.30.2