lib/test_printf: Switch to bitmap_zalloc()
PATCH 1/1 lib/test_printf: Switch to bitmap_zalloc()
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *.
--- lib/test_printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/test_printf.c +2 -2
@@ -481,14 +481,14 @@ static void __initlarge_bitmap (void) {const int nbits =1 <<16 ; -unsigned long *bits =kcalloc (BITS_TO_LONGS (nbits),sizeof (long ),GFP_KERNEL ); +unsigned long *bits =bitmap_zalloc (nbits,GFP_KERNEL );if (!bits)return ;bitmap_set (bits,1 ,20 );bitmap_set (bits,60000 ,15 );test ("1-20,60000-60014" ,"%*pbl" , nbits, bits); -kfree (bits); +bitmap_free (bits); } static void __init
Signature · 1 line
2.20.1
+Cc: Petr
Quoted 32 lines · Andy Shevchenko
Switch to
bitmap_zalloc()to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *.Signed-off-by Andy Shevchenko <[email protected]>--- lib/test_printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/test_printf.c +2
-2@@ -481,14 +481,14 @@ static void __initlarge_bitmap (void) {const int nbits =1 <<16 ; -unsigned long *bits =kcalloc (BITS_TO_LONGS (nbits),sizeof (long ),GFP_KERNEL ); +unsigned long *bits =bitmap_zalloc (nbits,GFP_KERNEL );if (!bits)return ;bitmap_set (bits,1 ,20 );bitmap_set (bits,60000 ,15 );test ("1-20,60000-60014" ,"%*pbl" , nbits, bits); -kfree (bits); +bitmap_free (bits); } static void __initSignature · 1 line
2.20.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Switch to
bitmap_zalloc()to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *.Signed-off-by Andy Shevchenko <[email protected]>
I have already sent pull request for 5.1. I could put it into printk.git, for-5.2 branch.
Andrew, feel free to take it, especially if you are still going to pull request for 5.1.
Best Regards,
Petr
Quoted 5 lines · Petr Mladek
Quoted 2 lines · Andy Shevchenko
Switch to
bitmap_zalloc()to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *.Reviewed-by Petr Mladek <[email protected]>
Thanks!
Quoted 2 lines
I have already sent pull request for 5.1. I could put it into printk.git, for-5.2 branch.
It's not in v5.1-rc1, so, feel free to proceed as usual thru your tree.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · Petr Mladek
Quoted 2 lines · Andy Shevchenko
Switch to
bitmap_zalloc()to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *.
Quoted 8 lines
Quoted 1 line
Reviewed-by Petr Mladek <[email protected]>Thanks!
Quoted 2 lines
I have already sent pull request for 5.1. I could put it into printk.git, for-5.2 branch.
It's not in v5.1-rc1, so, feel free to proceed as usual thru your tree.
I have commited the patch into printk.git, branch for-5.2.
Best Regards,
Petr