Linux clock framework development
 help / color / mirror / Atom feed
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>


      reply	other threads:[~2026-05-12 14:53 UTC|newest]

Thread overview: 2+ 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]

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.com \
    --cc=afd@ti.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=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=sozdayvek@gmail.com \
    --cc=ssantosh@kernel.org \
    --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