lib/test_vmalloc.c: three trivial fixes
Subsystems (2)
cover lib/test_vmalloc.c: three trivial fixes
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(-)
Signature · 1 line
2.39.2
PATCH 1/3 lib/test_vmalloc.c: fix typo in function name
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.
--- lib/test_vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/test_vmalloc.c +2 -2
@@ -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 ;
Signature · 1 line
2.39.2
Re: [PATCH 1/3] lib/test_vmalloc.c: fix typo in function name
Quoted 34 lines · 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 <[email protected]>--- lib/test_vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/test_vmalloc.c +2
-2@@ -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 ;Signature · 1 line
2.39.2
--
Uladzislau Rezki
PATCH 2/3 lib/test_vmalloc.c: drop empty exit function
In reply to Martin KaiserThe module is never loaded successfully. Therefore, it'll never be unloaded and we can remove the exit function.
--- lib/test_vmalloc.c | 5 ----- 1 file changed, 5 deletions(-)
lib/test_vmalloc.c +0 -5
@@ -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" );
Signature · 1 line
2.39.2
Re: [PATCH 2/3] lib/test_vmalloc.c: drop empty exit function
Quoted 28 lines · 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 <[email protected]>--- lib/test_vmalloc.c | 5 ----- 1 file changed, 5 deletions(-)lib/test_vmalloc.c +0
-5@@ -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" );Signature · 1 line
2.39.2
--
Uladzislau Rezki
PATCH 3/3 lib/test_vmalloc.c: use unsigned long constant
In reply to Martin KaiserUse 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;
--- lib/test_vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_vmalloc.c +1 -1
@@ -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 ));
Signature · 1 line
2.39.2
Re: [PATCH 3/3] lib/test_vmalloc.c: use unsigned long constant
Quoted 27 lines · 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 <[email protected]>--- lib/test_vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/test_vmalloc.c +1
-1@@ -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 ));Signature · 1 line
2.39.2
--
Uladzislau Rezki