Skip to content

Commit 4b65d53

Browse files
AaronDotvinodkoul
authored andcommitted
dmaengine: loongson2-apb: Change GENMASK to GENMASK_ULL
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: 71e7d3c ("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>
1 parent f0e870a commit 4b65d53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/loongson2-apb-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define LDMA_ASK_VALID BIT(2)
3232
#define LDMA_START BIT(3) /* DMA start operation */
3333
#define LDMA_STOP BIT(4) /* DMA stop operation */
34-
#define LDMA_CONFIG_MASK GENMASK(4, 0) /* DMA controller config bits mask */
34+
#define LDMA_CONFIG_MASK GENMASK_ULL(4, 0) /* DMA controller config bits mask */
3535

3636
/* Bitfields in ndesc_addr field of HW descriptor */
3737
#define LDMA_DESC_EN BIT(0) /*1: The next descriptor is valid */

0 commit comments

Comments
 (0)