Message ID | 20210802152201.1158412-1-arnd@kernel.org |
---|---|
State | New |
Headers | show |
Series | net: sparx5: fix bitmask on 32-bit targets | expand |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Mon, 2 Aug 2021 17:21:53 +0200 you wrote: > From: Arnd Bergmann <arnd@arndb.de> > > I saw the build failure that was fixed in commit 6387f65e2acb ("net: > sparx5: fix compiletime_assert for GCC 4.9") and noticed another > issue that was introduced in the same patch: Using GENMASK() to > create a 64-bit mask does not work on 32-bit architectures. > > [...] Here is the summary with links: - net: sparx5: fix bitmask on 32-bit targets https://git.kernel.org/netdev/net/c/f41e57af926a You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c index 1a240e6bddd0..cb68eaaac881 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c @@ -32,7 +32,7 @@ static void __ifh_encode_bitfield(void *ifh, u64 value, u32 pos, u32 width) u32 byte = (35 - (pos / 8)); /* Calculate the Start bit position in the Start IFH byte */ u32 bit = (pos % 8); - u64 encode = GENMASK(bit + width - 1, bit) & (value << bit); + u64 encode = GENMASK_ULL(bit + width - 1, bit) & (value << bit); /* The b0-b7 goes into the start IFH byte */ if (encode & 0xFF)