From: Nishanth Menon <nm@ti.com>
To: Brian Masney <bmasney@redhat.com>,
Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Tero Kristo <kristo@kernel.org>, Nishanth Menon <nm@ti.com>
Cc: <linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Jing Yangyang <jing.yangyang@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>, kernel test robot <lkp@intel.com>,
Julia Lawall <julia.lawall@inria.fr>,
David Yang <davidcomponentone@gmail.com>,
Jing Yangyang <cgel.zte@gmail.com>,
Ran Sun <sunran001@208suo.com>
Subject: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
Date: Fri, 8 May 2026 10:23:21 -0500 [thread overview]
Message-ID: <20260508152321.3683799-1-nm@ti.com> (raw)
From: Jing Yangyang <jing.yangyang@zte.com.cn>
Coccinelle (scripts/coccinelle/misc/noderef.cocci) reports:
drivers/clk/keystone/sci-clk.c:391:8-14: ERROR: application of
sizeof to pointer
provider->clocks is an array of struct sci_clk *, so bsearch()
expects the size of each element (struct sci_clk *). However,
sizeof(clk) evaluates to the size of a pointer-to-pointer.
Use sizeof(*clk) to pass the correct element size.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Closes: https://lore.kernel.org/all/84a6ba16686347099a3dab2e5161a930e792eb6e.1629198281.git.jing.yangyang@zte.com.cn/
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/all/202512040525.zrHSDl5h-lkp@intel.com/
Link: https://lore.kernel.org/linux-clk/20211012021931.176727-1-davidcomponentone@gmail.com/
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
[nm@ti.com: Improved commit message]
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Cc: Jing Yangyang <cgel.zte@gmail.com>
Cc: Ran Sun <sunran001@208suo.com>
- Functionality: No impact (on Linux architectures), thus no Fixes/Stable tag.
- History: This patch has long-standing history; I have attributed it to the
earliest valid author found during a recent scrub.
- Reports: Retained chronological attribution even where public reports (Zeal
Robot) are unavailable.
- Checkpatch: Acknowledging minor warning regarding tag ordering (Reported-by
/ Closes sequence); chosen to maintain link integrity for automated tools.
- Testing: Verified on available K3 SoCs against 2026-05-07:
https://gist.github.com/nmenon/afa9ac915e189334f048c177f16fe54f
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 9d5071223f4c..2fc1f050779b 100644
--- a/drivers/clk/keystone/sci-clk.c
+++ b/drivers/clk/keystone/sci-clk.c
@@ -388,7 +388,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);
--
2.47.0
next reply other threads:[~2026-05-08 15:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 15:23 Nishanth Menon [this message]
2026-05-08 16:59 ` [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer Andrew Davis
2026-05-08 17:07 ` Nishanth Menon
2026-05-09 11:34 ` Stepan Ionichev
[not found] <20230721011303.4303-1-xujianghui@cdjrlc.com>
2023-07-21 1:14 ` 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508152321.3683799-1-nm@ti.com \
--to=nm@ti.com \
--cc=bmasney@redhat.com \
--cc=cgel.zte@gmail.com \
--cc=davidcomponentone@gmail.com \
--cc=jing.yangyang@zte.com.cn \
--cc=julia.lawall@inria.fr \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=ssantosh@kernel.org \
--cc=sunran001@208suo.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox