Re: [PATCH] riscv/atomic: Do proper sign extension also for unsigned in arch_cmpxchg

From: patchwork-bot+linux-riscv
Date: Thu Feb 13 2025 - 13:31:54 EST


Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@xxxxxxxxxxxx>:

On Thu, 30 Jan 2025 10:25:38 +0100 you wrote:
> Sign extend also an unsigned compare value to match what lr.w is doing.
> Otherwise try_cmpxchg may spuriously return true when used on a u32 value
> that has the sign bit set, as it happens often in inode_set_ctime_current.
>
> Do this in three conversion steps. The first conversion to long is needed
> to avoid a -Wpointer-to-int-cast warning when arch_cmpxchg is used with a
> pointer type. Then convert to int and back to long to always sign extend
> the 32-bit value to 64-bit.
>
> [...]

Here is the summary with links:
- riscv/atomic: Do proper sign extension also for unsigned in arch_cmpxchg
https://git.kernel.org/riscv/c/431a3bbd3249

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html