mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
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
This commit is contained in:
parent
7d5775d49e
commit
52e68cd60d
1 changed files with 2 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue