From: Stepan Ionichev <sozdayvek@gmail.com>
To: nm@ti.com
Cc: sboyd@kernel.org, mturquette@baylibre.com, afd@ti.com,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, sozdayvek@gmail.com
Subject: Re: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer
Date: Sat, 9 May 2026 16:34:25 +0500 [thread overview]
Message-ID: <20260509113425.25402-1-sozdayvek@gmail.com> (raw)
In-Reply-To: <20260508152321.3683799-1-nm@ti.com>
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@gmail.com>
Stepan
next prev parent reply other threads:[~2026-05-09 18:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 15:23 [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer Nishanth Menon
2026-05-08 16:59 ` Andrew Davis
2026-05-08 17:07 ` Nishanth Menon
2026-05-09 11:34 ` Stepan Ionichev [this message]
[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=20260509113425.25402-1-sozdayvek@gmail.com \
--to=sozdayvek@gmail.com \
--cc=afd@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=nm@ti.com \
--cc=sboyd@kernel.org \
/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