LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
@ 2021-08-17 19:37 Yury Norov
  2021-08-18  9:17 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Yury Norov @ 2021-08-17 19:37 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel
  Cc: Yury Norov, Andy Shevchenko, Petr Mladek, Rasmus Villemoes,
	Sergey Senozhatsky, Stephen Rothwell, Steven Rostedt,
	Andy Shevchenko

Increment is confusing as the buf is overritten at the same line.

Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 lib/vsprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 29a384eee286..919b70d00855 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1261,7 +1261,7 @@ char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap,
 
 		if (buf < end)
 			*buf = '-';
-		buf = number(++buf, end, rtop - 1, default_dec_spec);
+		buf = number(buf + 1, end, rtop - 1, default_dec_spec);
 	}
 	return buf;
 }
-- 
2.30.2


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

* Re: [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
  2021-08-17 19:37 [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string Yury Norov
@ 2021-08-18  9:17 ` Andy Shevchenko
  2021-08-18 19:36   ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2021-08-18  9:17 UTC (permalink / raw)
  To: Yury Norov
  Cc: Andrew Morton, linux-kernel, Petr Mladek, Rasmus Villemoes,
	Sergey Senozhatsky, Stephen Rothwell, Steven Rostedt

On Tue, Aug 17, 2021 at 12:37:35PM -0700, Yury Norov wrote:

Thanks!

> Increment is confusing as the buf is overritten at the same line.

> Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)

Fixes tag has its special format. I don't think we need it here, just to ask
Andrew in comments that it needs to be folded.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
  2021-08-18  9:17 ` Andy Shevchenko
@ 2021-08-18 19:36   ` Andrew Morton
  2021-08-18 20:10     ` Yury Norov
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2021-08-18 19:36 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Yury Norov, linux-kernel, Petr Mladek, Rasmus Villemoes,
	Sergey Senozhatsky, Stephen Rothwell, Steven Rostedt

On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Tue, Aug 17, 2021 at 12:37:35PM -0700, Yury Norov wrote:
> 
> Thanks!
> 
> > Increment is confusing as the buf is overritten at the same line.
> 
> > Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
> 
> Fixes tag has its special format. I don't think we need it here, just to ask
> Andrew in comments that it needs to be folded.

I'm assuming that Sergey will be handling this one?

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

* Re: [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
  2021-08-18 19:36   ` Andrew Morton
@ 2021-08-18 20:10     ` Yury Norov
  2021-08-19  9:35       ` Sergey Senozhatsky
  0 siblings, 1 reply; 5+ messages in thread
From: Yury Norov @ 2021-08-18 20:10 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Shevchenko, linux-kernel, Petr Mladek, Rasmus Villemoes,
	Sergey Senozhatsky, Stephen Rothwell, Steven Rostedt

On Wed, Aug 18, 2021 at 12:36:51PM -0700, Andrew Morton wrote:
> On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > On Tue, Aug 17, 2021 at 12:37:35PM -0700, Yury Norov wrote:
> > 
> > Thanks!
> > 
> > > Increment is confusing as the buf is overritten at the same line.
> > 
> > > Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
> > 
> > Fixes tag has its special format. I don't think we need it here, just to ask
> > Andrew in comments that it needs to be folded.
> 
> I'm assuming that Sergey will be handling this one?

This is a fix to recent bitmap series. If you fold-in into
b1c4af4d3d6b, would be also OK.

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

* Re: [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
  2021-08-18 20:10     ` Yury Norov
@ 2021-08-19  9:35       ` Sergey Senozhatsky
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey Senozhatsky @ 2021-08-19  9:35 UTC (permalink / raw)
  To: Yury Norov
  Cc: Andrew Morton, Andy Shevchenko, linux-kernel, Petr Mladek,
	Rasmus Villemoes, Sergey Senozhatsky, Stephen Rothwell,
	Steven Rostedt

On (21/08/18 13:10), Yury Norov wrote:
> On Wed, Aug 18, 2021 at 12:36:51PM -0700, Andrew Morton wrote:
> > On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > 
> > > On Tue, Aug 17, 2021 at 12:37:35PM -0700, Yury Norov wrote:
> > > 
> > > Thanks!
> > > 
> > > > Increment is confusing as the buf is overritten at the same line.
> > > 
> > > > Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
> > > 
> > > Fixes tag has its special format. I don't think we need it here, just to ask
> > > Andrew in comments that it needs to be folded.
> > 
> > I'm assuming that Sergey will be handling this one?
> 
> This is a fix to recent bitmap series. If you fold-in into
> b1c4af4d3d6b, would be also OK.

This type of patches simpler to handle when they sent as a reply
to the patch they fix.

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

end of thread, other threads:[~2021-08-19  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 19:37 [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string Yury Norov
2021-08-18  9:17 ` Andy Shevchenko
2021-08-18 19:36   ` Andrew Morton
2021-08-18 20:10     ` Yury Norov
2021-08-19  9:35       ` Sergey Senozhatsky

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