[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea5f8416-64da-4a26-8706-bc7ace502ad1@nvidia.com>
Date: Tue, 6 May 2025 11:06:35 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: Aaron Kling <webgeek1234@...il.com>
Cc: Laxman Dewangan <ldewangan@...dia.com>, Mark Brown <broonie@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Mason Zhang <Mason.Zhang@...iatek.com>, linux-spi@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] spi: tegra114: Don't fail set_cs_timing when delays are
zero
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
Powered by blists - more mailing lists