lib/test_vmalloc.c: use unsigned long constant
authorMartin Kaiser <martin@kaiser.cx>
Mon, 26 Feb 2024 19:11:59 +0000 (20:11 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 5 Mar 2024 01:01:22 +0000 (17:01 -0800)
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>
lib/test_vmalloc.c

index d0c0cbe1913d7910f0748ac958f1c5721e8c887a..4ddf769861ff769fd891b58b2547691ec9c82cc3 100644 (file)
@@ -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));