summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-11-27 15:27:35 +0100
committerPetr Mladek <pmladek@suse.com>2021-12-06 13:35:28 +0100
commit52e68cd60ddf11802f5135921aba77c0833909a8 (patch)
tree36d219a085e818da7c1d30b8c65af2204d948359 /lib/vsprintf.c
parent7d5775d49e4a488bc8a07e5abb2b71a4c28aadbb (diff)
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 <christophe.jaillet@wanadoo.fr> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/1abf81a5e509d372393bd22041eed4ebc07ef9f7.1638023178.git.christophe.jaillet@wanadoo.fr
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c4
1 files changed, 2 insertions, 2 deletions
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 */