]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lib/vsprintf: use bool for local decode variable
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 7 Apr 2026 18:18:36 +0000 (20:18 +0200)
committerPetr Mladek <pmladek@suse.com>
Tue, 14 Apr 2026 13:58:51 +0000 (15:58 +0200)
The local variable 'decode' is only used as a boolean value - change its
data type from int to bool accordingly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://patch.msgid.link/20260407181835.1053072-2-thorsten.blum@linux.dev
Signed-off-by: Petr Mladek <pmladek@suse.com>
lib/vsprintf.c

index a3790c43a0abaf7d7e2b16e2fa606fb9fd4d4117..2871ffd2810390a9d04362325890772130858ef1 100644 (file)
@@ -1106,7 +1106,7 @@ char *resource_string(char *buf, char *end, struct resource *res,
                     2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)];
 
        char *p = sym, *pend = sym + sizeof(sym);
-       int decode = (fmt[0] == 'R') ? 1 : 0;
+       bool decode = fmt[0] == 'R';
        const struct printf_spec *specp;
 
        if (check_pointer(&buf, end, res, spec))
@@ -1131,7 +1131,7 @@ char *resource_string(char *buf, char *end, struct resource *res,
        } else {
                p = string_nocheck(p, pend, "??? ", str_spec);
                specp = &mem_spec;
-               decode = 0;
+               decode = false;
        }
        if (decode && res->flags & IORESOURCE_UNSET) {
                p = string_nocheck(p, pend, "size ", str_spec);