[PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
Stepan Ionichev
sozdayvek at gmail.com
Sat May 9 04:34:25 PDT 2026
In sci_clk_get(), 'clk' is declared as 'struct sci_clk **', so
sizeof(clk) is sizeof(struct sci_clk **) which is the size of a
pointer rather than the size of an array element. provider->clocks
is an array of 'struct sci_clk *', so the canonical size argument
to bsearch() is sizeof(*clk) (i.e. sizeof(struct sci_clk *)).
The two values are equal on every supported architecture, so this
is correctness/idiom, not a runtime fix, but the new form matches
the rest of the bsearch() callers in the tree and silences the
Coccinelle warning the script flagged.
Reviewed-by: Stepan Ionichev <sozdayvek at gmail.com>
Stepan
More information about the linux-arm-kernel
mailing list