Skip to contentSkip to conversation

lib/vsprintf: don't increment buf in bitmap_list_string

PATCH In review Yury Norov 4 participants 5 messages Aug 17, 2021 – Aug 19, 2021

Subsystems (2)
lore
Share & tools
lore

Yury Norov

author
#0 lore raw

PATCH 1/1 lib/vsprintf: don't increment buf in bitmap_list_string

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

Fixes b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
---
 lib/vsprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/vsprintf.c +1 -1
index 29a384eee286..919b70d00855 100644
@@ -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;
 }
Signature · 1 line
2.30.2
#1 lore raw

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

Thanks!

Quoted 3 lines

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#2 lore raw
Quoted 10 lines · On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko…

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

Thanks!

Quoted 3 lines

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?

author
#3 lore raw
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko…

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

Thanks!

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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.

#4 lore raw
Quoted 11 lines · Yury Norov
Quoted 10 lines · Andrew Morton
Quoted 8 lines · On Wed, 18 Aug 2021 12:17:18 +0300 Andy Shevchenko…

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

Thanks!

Quoted 3 lines

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

Fixes b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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.