Skip to content

Commit

Permalink
lib/test_vmalloc.c: use unsigned long constant
Browse files Browse the repository at this point in the history
Use an unsigned long constant instead of an int constant and a cast.  This
fixes the checkpatch warning

WARNING: Unnecessary typecast of c90 int constant - '(unsigned long) 1' could be '1UL'
+     align = ((unsigned long) 1) << i;

Link: https://lkml.kernel.org/r/20240226191159.39509-4-martin@kaiser.cx
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
martin-kaiser authored and akpm00 committed Mar 5, 2024
1 parent e2c5bfe commit 4c4a525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int align_shift_alloc_test(void)
int i;

for (i = 0; i < BITS_PER_LONG; i++) {
align = ((unsigned long) 1) << i;
align = 1UL << i;

ptr = __vmalloc_node(PAGE_SIZE, align, GFP_KERNEL|__GFP_ZERO, 0,
__builtin_return_address(0));
Expand Down

0 comments on commit 4c4a525

Please sign in to comment.