Skip to content

Commit 52e68cd

Browse files
tititiou36pmladek
authored andcommitted
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 <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/1abf81a5e509d372393bd22041eed4ebc07ef9f7.1638023178.git.christophe.jaillet@wanadoo.fr
1 parent 7d5775d commit 52e68cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/vsprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
35643564
++fmt;
35653565

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

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

35803580
/* match must be non-empty */

0 commit comments

Comments
 (0)