linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()
@ 2019-03-04 10:00 Andy Shevchenko
  2019-03-07 14:12 ` Andy Shevchenko
  2019-03-08  9:37 ` Petr Mladek
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2019-03-04 10:00 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, linux; +Cc: 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 <andriy.shevchenko@linux.intel.com>
---
 lib/test_printf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/test_printf.c b/lib/test_printf.c
index 659b6cc0d483..e8206d8d2d08 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -481,14 +481,14 @@ static void __init
 large_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
-- 
2.20.1


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

* Re: [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()
  2019-03-04 10:00 [PATCH v1] lib/test_printf: Switch to bitmap_zalloc() Andy Shevchenko
@ 2019-03-07 14:12 ` Andy Shevchenko
  2019-03-08  9:37 ` Petr Mladek
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2019-03-07 14:12 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, linux; +Cc: Petr Mladek

+Cc: Petr

On Mon, Mar 04, 2019 at 12:00:09PM +0200, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>
> ---
>  lib/test_printf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/test_printf.c b/lib/test_printf.c
> index 659b6cc0d483..e8206d8d2d08 100644
> --- a/lib/test_printf.c
> +++ b/lib/test_printf.c
> @@ -481,14 +481,14 @@ static void __init
>  large_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
> -- 
> 2.20.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()
  2019-03-04 10:00 [PATCH v1] lib/test_printf: Switch to bitmap_zalloc() Andy Shevchenko
  2019-03-07 14:12 ` Andy Shevchenko
@ 2019-03-08  9:37 ` Petr Mladek
  2019-03-18 15:12   ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Petr Mladek @ 2019-03-08  9:37 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andrew Morton, linux

On Mon 2019-03-04 12:00:09, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>

Reviewed-by: Petr Mladek <pmladek@suse.com>

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

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

* Re: [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()
  2019-03-08  9:37 ` Petr Mladek
@ 2019-03-18 15:12   ` Andy Shevchenko
  2019-03-20 14:38     ` Petr Mladek
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2019-03-18 15:12 UTC (permalink / raw)
  To: Petr Mladek; +Cc: linux-kernel, Andrew Morton, linux

On Fri, Mar 08, 2019 at 10:37:29AM +0100, Petr Mladek wrote:
> On Mon 2019-03-04 12:00:09, Andy Shevchenko wrote:
> > 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 <pmladek@suse.com>

Thanks!

> 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.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1] lib/test_printf: Switch to bitmap_zalloc()
  2019-03-18 15:12   ` Andy Shevchenko
@ 2019-03-20 14:38     ` Petr Mladek
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Mladek @ 2019-03-20 14:38 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andrew Morton, linux

On Mon 2019-03-18 17:12:55, Andy Shevchenko wrote:
> On Fri, Mar 08, 2019 at 10:37:29AM +0100, Petr Mladek wrote:
> > On Mon 2019-03-04 12:00:09, Andy Shevchenko wrote:
> > > 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 <pmladek@suse.com>
> 
> Thanks!
> 
> > 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

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

end of thread, other threads:[~2019-03-20 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 10:00 [PATCH v1] lib/test_printf: Switch to bitmap_zalloc() Andy Shevchenko
2019-03-07 14:12 ` Andy Shevchenko
2019-03-08  9:37 ` Petr Mladek
2019-03-18 15:12   ` Andy Shevchenko
2019-03-20 14:38     ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).