public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] lib/test_vmalloc.c: three trivial fixes
@ 2024-02-26 19:11 Martin Kaiser
  2024-02-26 19:11 ` [PATCH 1/3] lib/test_vmalloc.c: fix typo in function name Martin Kaiser
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Martin Kaiser @ 2024-02-26 19:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Uladzislau Rezki, linux-kernel, Martin Kaiser

Here's three trivial changes to fix a typo, address a checkpatch warning and
remove an unused function.

Martin Kaiser (3):
  lib/test_vmalloc.c: fix typo in function name
  lib/test_vmalloc.c: drop empty exit function
  lib/test_vmalloc.c: use unsigned long constant

 lib/test_vmalloc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] lib/test_vmalloc.c: fix typo in function name
  2024-02-26 19:11 [PATCH 0/3] lib/test_vmalloc.c: three trivial fixes Martin Kaiser
@ 2024-02-26 19:11 ` 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-26 19:11 ` [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant Martin Kaiser
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Kaiser @ 2024-02-26 19:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Uladzislau Rezki, linux-kernel, Martin Kaiser

Fix a typo and change the function name to init_test_configuration. Both
caller and definition have the same typo, so the current code already
works.

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

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index 3718d9886407..191b6bd5dff9 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -501,7 +501,7 @@ static int test_func(void *private)
 }
 
 static int
-init_test_configurtion(void)
+init_test_configuration(void)
 {
 	/*
 	 * A maximum number of workers is defined as hard-coded
@@ -531,7 +531,7 @@ static void do_concurrent_test(void)
 	/*
 	 * Set some basic configurations plus sanity check.
 	 */
-	ret = init_test_configurtion();
+	ret = init_test_configuration();
 	if (ret < 0)
 		return;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] lib/test_vmalloc.c: drop empty exit function
  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-26 19:11 ` 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
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Kaiser @ 2024-02-26 19:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Uladzislau Rezki, linux-kernel, Martin Kaiser

The module is never loaded successfully. Therefore, it'll never be
unloaded and we can remove the exit function.

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

diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index 191b6bd5dff9..d0c0cbe1913d 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -600,12 +600,7 @@ static int vmalloc_test_init(void)
 	return -EAGAIN; /* Fail will directly unload the module */
 }
 
-static void vmalloc_test_exit(void)
-{
-}
-
 module_init(vmalloc_test_init)
-module_exit(vmalloc_test_exit)
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Uladzislau Rezki");
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant
  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-26 19:11 ` [PATCH 2/3] lib/test_vmalloc.c: drop empty exit function Martin Kaiser
@ 2024-02-26 19:11 ` Martin Kaiser
  2024-02-27  6:59   ` Uladzislau Rezki
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Kaiser @ 2024-02-26 19:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Uladzislau Rezki, linux-kernel, Martin Kaiser

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] lib/test_vmalloc.c: fix typo in function name
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Uladzislau Rezki @ 2024-02-27  6:59 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: Andrew Morton, Uladzislau Rezki, linux-kernel

On Mon, Feb 26, 2024 at 08:11:57PM +0100, Martin Kaiser wrote:
> Fix a typo and change the function name to init_test_configuration. Both
> caller and definition have the same typo, so the current code already
> works.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  lib/test_vmalloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> index 3718d9886407..191b6bd5dff9 100644
> --- a/lib/test_vmalloc.c
> +++ b/lib/test_vmalloc.c
> @@ -501,7 +501,7 @@ static int test_func(void *private)
>  }
>  
>  static int
> -init_test_configurtion(void)
> +init_test_configuration(void)
>  {
>  	/*
>  	 * A maximum number of workers is defined as hard-coded
> @@ -531,7 +531,7 @@ static void do_concurrent_test(void)
>  	/*
>  	 * Set some basic configurations plus sanity check.
>  	 */
> -	ret = init_test_configurtion();
> +	ret = init_test_configuration();
>  	if (ret < 0)
>  		return;
>  
> -- 
> 2.39.2
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Uladzislau Rezki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] lib/test_vmalloc.c: drop empty exit function
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Uladzislau Rezki @ 2024-02-27  6:59 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: Andrew Morton, Uladzislau Rezki, linux-kernel

On Mon, Feb 26, 2024 at 08:11:58PM +0100, Martin Kaiser wrote:
> The module is never loaded successfully. Therefore, it'll never be
> unloaded and we can remove the exit function.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  lib/test_vmalloc.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
> index 191b6bd5dff9..d0c0cbe1913d 100644
> --- a/lib/test_vmalloc.c
> +++ b/lib/test_vmalloc.c
> @@ -600,12 +600,7 @@ static int vmalloc_test_init(void)
>  	return -EAGAIN; /* Fail will directly unload the module */
>  }
>  
> -static void vmalloc_test_exit(void)
> -{
> -}
> -
>  module_init(vmalloc_test_init)
> -module_exit(vmalloc_test_exit)
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Uladzislau Rezki");
> -- 
> 2.39.2
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Uladzislau Rezki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Uladzislau Rezki @ 2024-02-27  6:59 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: Andrew Morton, Uladzislau Rezki, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-27  6:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox