* [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable
@ 2025-07-25 17:17 Colin Ian King
2025-07-25 22:14 ` Mark Brown
2025-07-28 2:13 ` Xianwei Zhao
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2025-07-25 17:17 UTC (permalink / raw)
To: Sunny Luo, Xianwei Zhao, Mark Brown, linux-amlogic, linux-spi
Cc: kernel-janitors, linux-kernel
The check for ns < 0 is always false because variable ns is a u32 which
is not a signed type. Fix this by making ns a s32 type.
Fixes: cef9991e04ae ("spi: Add Amlogic SPISG driver")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/spi/spi-amlogic-spisg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index 48a5325b4db7..2ab8bdf2a676 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -163,7 +163,7 @@ struct spisg_device {
static int spi_delay_to_sclk(u32 slck_speed_hz, struct spi_delay *delay)
{
- u32 ns;
+ s32 ns;
if (!delay)
return 0;
--
2.50.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable
2025-07-25 17:17 [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable Colin Ian King
@ 2025-07-25 22:14 ` Mark Brown
2025-07-28 2:13 ` Xianwei Zhao
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-07-25 22:14 UTC (permalink / raw)
To: Sunny Luo, Xianwei Zhao, linux-amlogic, linux-spi, Colin Ian King
Cc: kernel-janitors, linux-kernel
On Fri, 25 Jul 2025 18:17:01 +0100, Colin Ian King wrote:
> The check for ns < 0 is always false because variable ns is a u32 which
> is not a signed type. Fix this by making ns a s32 type.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: SPISG: Fix less than zero comparison on a u32 variable
commit: 2d442a0c781403702de27ccfbc4bb233721585f5
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable
2025-07-25 17:17 [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable Colin Ian King
2025-07-25 22:14 ` Mark Brown
@ 2025-07-28 2:13 ` Xianwei Zhao
1 sibling, 0 replies; 3+ messages in thread
From: Xianwei Zhao @ 2025-07-28 2:13 UTC (permalink / raw)
To: Colin Ian King, Sunny Luo, Mark Brown, linux-amlogic, linux-spi
Cc: kernel-janitors, linux-kernel
Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
On 2025/7/26 01:17, Colin Ian King wrote:
> [Some people who received this message don't often get email from colin.i.king@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> [ EXTERNAL EMAIL ]
>
> The check for ns < 0 is always false because variable ns is a u32 which
> is not a signed type. Fix this by making ns a s32 type.
>
> Fixes: cef9991e04ae ("spi: Add Amlogic SPISG driver")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/spi/spi-amlogic-spisg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
> index 48a5325b4db7..2ab8bdf2a676 100644
> --- a/drivers/spi/spi-amlogic-spisg.c
> +++ b/drivers/spi/spi-amlogic-spisg.c
> @@ -163,7 +163,7 @@ struct spisg_device {
>
> static int spi_delay_to_sclk(u32 slck_speed_hz, struct spi_delay *delay)
> {
> - u32 ns;
> + s32 ns;
>
> if (!delay)
> return 0;
> --
> 2.50.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-28 2:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 17:17 [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable Colin Ian King
2025-07-25 22:14 ` Mark Brown
2025-07-28 2:13 ` Xianwei Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).