mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Uladzislau Rezki <urezki@gmail.com>,
	linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant
Date: Mon, 26 Feb 2024 20:11:59 +0100	[thread overview]
Message-ID: <20240226191159.39509-4-martin@kaiser.cx> (raw)
In-Reply-To: <20240226191159.39509-1-martin@kaiser.cx>

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;

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 lib/test_vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index d0c0cbe1913d..4ddf769861ff 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -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));
-- 
2.39.2


  parent reply	other threads:[~2024-02-26 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 19:11 [PATCH 0/3] lib/test_vmalloc.c: three trivial fixes Martin Kaiser
2024-02-26 19:11 ` [PATCH 1/3] lib/test_vmalloc.c: fix typo in function name Martin Kaiser
2024-02-27  6:59   ` Uladzislau Rezki
2024-02-26 19:11 ` [PATCH 2/3] lib/test_vmalloc.c: drop empty exit function Martin Kaiser
2024-02-27  6:59   ` Uladzislau Rezki
2024-02-26 19:11 ` Martin Kaiser [this message]
2024-02-27  6:59   ` [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226191159.39509-4-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=urezki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®