[PATCH] vsprintf: Use non-atomic bitmap API when applicable

From: Christophe JAILLET
Date: Sat Nov 27 2021 - 09:29:45 EST


The 'set' bitmap is local to this function. No concurrent access to it is
possible.
So prefer the non-atomic '__[set|clear]_bit()' function to save a few
cycles.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
lib/vsprintf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 9a2bc00b5952..c130dcaca5e2 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -3566,7 +3566,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
++fmt;

for ( ; *fmt && *fmt != ']'; ++fmt, ++len)
- set_bit((u8)*fmt, set);
+ __set_bit((u8)*fmt, set);

/* no ']' or no character set found */
if (!*fmt || !len)
@@ -3576,7 +3576,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
if (negate) {
bitmap_complement(set, set, 256);
/* exclude null '\0' byte */
- clear_bit(0, set);
+ __clear_bit(0, set);
}

/* match must be non-empty */
--
2.30.2