public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant
Date: Tue, 27 Feb 2024 07:59:40 +0100	[thread overview]
Message-ID: <Zd2IXEsx2YAOaALt@pc636> (raw)
In-Reply-To: <20240226191159.39509-4-martin@kaiser.cx>

On Mon, Feb 26, 2024 at 08:11:59PM +0100, Martin Kaiser wrote:
> 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
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Uladzislau Rezki

      reply	other threads:[~2024-02-27  6:59 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 ` [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant Martin Kaiser
2024-02-27  6:59   ` Uladzislau Rezki [this message]

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=Zd2IXEsx2YAOaALt@pc636 \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@kaiser.cx \
    /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