From: Christophe JAILLET Date: Sat, 27 Nov 2021 14:27:35 +0000 (+0100) Subject: vsprintf: Use non-atomic bitmap API when applicable X-Git-Tag: block-5.17-2022-01-21~82^2~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=52e68cd60ddf11802f5135921aba77c0833909a8;p=linux-block.git vsprintf: Use non-atomic bitmap API when applicable 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 Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/1abf81a5e509d372393bd22041eed4ebc07ef9f7.1638023178.git.christophe.jaillet@wanadoo.fr --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 58d5e567f836..53d6081f9e8b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3564,7 +3564,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) @@ -3574,7 +3574,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 */