From: Jon Hunter <jonathanh@nvidia.com>
To: Aaron Kling <webgeek1234@gmail.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
Mark Brown <broonie@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Mason Zhang <Mason.Zhang@mediatek.com>,
linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] spi: tegra114: Don't fail set_cs_timing when delays are zero
Date: Tue, 6 May 2025 11:06:35 +0100 [thread overview]
Message-ID: <ea5f8416-64da-4a26-8706-bc7ace502ad1@nvidia.com> (raw)
In-Reply-To: <CALHNRZ928KN6ZBDzdGWyabSQw4Hny6F5RdqZ4hBUZosPZtni1A@mail.gmail.com>
On 06/05/2025 10:50, Aaron Kling wrote:
...
>>> - if (setup->unit != SPI_DELAY_UNIT_SCK ||
>>> - hold->unit != SPI_DELAY_UNIT_SCK ||
>>> - inactive->unit != SPI_DELAY_UNIT_SCK) {
>>> + if ((setup->unit && setup->unit != SPI_DELAY_UNIT_SCK) ||
>>> + (hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) ||
>>> + (inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) {
>>
>> The above does not look correct to me. For example, if 'setup->unit' is
>> 0, this means that the unit is 'SPI_DELAY_UNIT_USECS' and does not
>> indicate that the delay is 0.
>>
>> Shouldn't the above be ...
>>
>> if ((setup && setup->unit != SPI_DELAY_UNIT_SCK) ||
>> (hold && hold->unit != SPI_DELAY_UNIT_SCK) ||
>> (inactive && inactive->unit != SPI_DELAY_UNIT_SCK)) {
>
> This is what the code looked like before 373c36b [0], which dropped
> that check because the pointers can never be NULL. Should this check
> if ->value is not 0 instead?
What the code does now does not match what you describe and does not
appear to be correct. Yes checking ->value is not 0 would make sense.
Jon
--
nvpublic
next prev parent reply other threads:[~2025-05-06 10:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 2:03 [PATCH] spi: tegra114: Don't fail set_cs_timing when delays are zero Aaron Kling via B4 Relay
2025-05-02 22:21 ` Mark Brown
2025-05-06 9:26 ` Jon Hunter
2025-05-06 9:50 ` Aaron Kling
2025-05-06 10:06 ` Jon Hunter [this message]
2025-05-06 10:12 ` Aaron Kling
2025-05-06 10:31 ` Jon Hunter
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=ea5f8416-64da-4a26-8706-bc7ace502ad1@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=Mason.Zhang@mediatek.com \
--cc=broonie@kernel.org \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=webgeek1234@gmail.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