From: Brian Masney <bmasney@redhat•com>
To: Nishanth Menon <nm@ti•com>
Cc: Stephen Boyd <sboyd@kernel•org>,
Michael Turquette <mturquette@baylibre•com>,
Santosh Shilimkar <ssantosh@kernel•org>,
Tero Kristo <kristo@kernel•org>,
linux-clk@vger•kernel.org, linux-kernel@vger•kernel.org,
linux-arm-kernel@lists•infradead.org, afd@ti•com,
sozdayvek@gmail•com, 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>
Subject: Re: [PATCH V2] clk: keystone: sci-clk: fix application of sizeof to pointer
Date: Tue, 12 May 2026 10:53:08 -0400 [thread overview]
Message-ID: <agM-1KOP9gZqxh_f@redhat.com> (raw)
In-Reply-To: <20260512110028.2999471-1-nm@ti.com>
On Tue, May 12, 2026 at 06:00:28AM -0500, Nishanth Menon wrote:
> 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
>
> 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.
>
> 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/
> Reviewed-by: Stepan Ionichev <sozdayvek@gmail•com>
> Reviewed-by: Andrew Davis <afd@ti•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>
Reviewed-by: Brian Masney <bmasney@redhat•com>
next prev parent reply other threads:[~2026-05-12 14:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 11:00 [PATCH V2] clk: keystone: sci-clk: fix application of sizeof to pointer Nishanth Menon
2026-05-12 14:53 ` Brian Masney [this message]
2026-06-04 2:59 ` 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=agM-1KOP9gZqxh_f@redhat.com \
--to=bmasney@redhat$(echo .)com \
--cc=afd@ti$(echo .)com \
--cc=davidcomponentone@gmail$(echo .)com \
--cc=jing.yangyang@zte$(echo .)com.cn \
--cc=julia.lawall@inria$(echo .)fr \
--cc=kristo@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-clk@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=lkp@intel$(echo .)com \
--cc=mturquette@baylibre$(echo .)com \
--cc=nm@ti$(echo .)com \
--cc=sboyd@kernel$(echo .)org \
--cc=sozdayvek@gmail$(echo .)com \
--cc=ssantosh@kernel$(echo .)org \
--cc=zealci@zte$(echo .)com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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