]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: loongson2-apb: Change GENMASK to GENMASK_ULL
authorBinbin Zhou <zhoubinbin@loongson.cn>
Mon, 30 Dec 2024 01:39:19 +0000 (09:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:21 +0000 (10:34 +0100)
commit908dd70d54463eec26660e91aaff0891cad11c6e
tree1a9afdda383da60fe5c92a31de53764c879569ce
parent79a47fd0f1766064d85c0cea80ca98166087705f
dmaengine: loongson2-apb: Change GENMASK to GENMASK_ULL

[ Upstream commit 4b65d5322e1d8994acfdb9b867aa00bdb30d177b ]

Fix the following smatch static checker warning:

drivers/dma/loongson2-apb-dma.c:189 ls2x_dma_write_cmd()
warn: was expecting a 64 bit value instead of '~(((0)) + (((~((0))) - (((1)) << (0)) + 1) & (~((0)) >> ((8 * 4) - 1 - (4)))))'

The GENMASK macro used "unsigned long", which caused build issues when
using a 32-bit toolchain because it would try to access bits > 31. This
patch switches GENMASK to GENMASK_ULL, which uses "unsigned long long".

Fixes: 71e7d3cb6e55 ("dmaengine: ls2x-apb: New driver for the Loongson LS2X APB DMA controller")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/87cdc025-7246-4548-85ca-3d36fdc2be2d@stanley.mountain/
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/20241028093413.1145820-1-zhoubinbin@loongson.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ls2x-apb-dma.c