From: David Lechner <dlechner@baylibre.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Robert Budai" <robert.budai@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: imu: adis16550: rework clock range test
Date: Wed, 2 Jul 2025 10:07:17 -0500 [thread overview]
Message-ID: <3778ad13-3b62-4f68-946d-b861b0df4272@baylibre.com> (raw)
In-Reply-To: <aGVJPRmn1-HUBb40@smile.fi.intel.com>
On 7/2/25 9:59 AM, Andy Shevchenko wrote:
> On Wed, Jul 02, 2025 at 05:53:57PM +0300, Andy Shevchenko wrote:
>> On Wed, Jul 02, 2025 at 09:27:45AM -0500, David Lechner wrote:
>>> Rework the clock rate range test to test if sync_mode_data != NULL
>>> instead of testing if the for loop index variable. This makes it easier
>>> for static analyzers to see that we aren't using an uninitialized
>>> sync_mode_data [1].
>>
>> But at the same time it makes it not to be the usual pattern.,,
>
> Reading the static analyser output I think the first hunk is only what we need,
> but this is still false positive and it's problem of that static
> analyser. Have you filed a bug there? (My point is that modifying the code for
> the advantage of false positives of some static analyser is wrong road to go
> in my opinion.)
>
I agree that we shouldn't fix this _only_ to make the static analyzer
happy. But I had to think quite a bit harder to see that the existing
code was correct compared to what I have proposed here.
But if this is a common pattern that I just haven't learned to identify
at a glance yet and everybody else can easily see that the existing code
is correct, then perhaps it isn't worth the change.
next prev parent reply other threads:[~2025-07-02 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 14:27 David Lechner
2025-07-02 14:53 ` Andy Shevchenko
2025-07-02 14:59 ` Andy Shevchenko
2025-07-02 15:07 ` David Lechner [this message]
2025-07-02 15:17 ` Andy Shevchenko
2025-07-02 15:31 ` Jonathan Cameron
2025-07-02 15:48 ` David Lechner
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=3778ad13-3b62-4f68-946d-b861b0df4272@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Michael.Hennerich@analog.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robert.budai@analog.com \
/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
all inboxes | Powered by JetHome®