summaryrefslogtreecommitdiff
path: root/kernel/locking
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-03-22 12:55:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-14 08:42:12 +0200
commitc65a000a236ecc24b5e7608920e8211e65242a58 (patch)
tree62face1c6705643bb63ca43af0618e0164d5f714 /kernel/locking
parent4c4aa344edf46ade886de6893364599df744bf06 (diff)
downloadlinux-c65a000a236ecc24b5e7608920e8211e65242a58.tar.gz
linux-c65a000a236ecc24b5e7608920e8211e65242a58.tar.bz2
linux-c65a000a236ecc24b5e7608920e8211e65242a58.zip
lockdep: Address clang -Wformat warning printing for %hd
commit 6d48b7912cc72275dc7c59ff961c8bac7ef66a92 upstream. Clang doesn't like format strings that truncate a 32-bit value to something shorter: kernel/locking/lockdep.c:709:4: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat] In this case, the warning is a slightly questionable, as it could realize that both class->wait_type_outer and class->wait_type_inner are in fact 8-bit struct members, even though the result of the ?: operator becomes an 'int'. However, there is really no point in printing the number as a 16-bit 'short' rather than either an 8-bit or 32-bit number, so just change it to a normal %d. Fixes: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210322115531.3987555-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/locking')
-rw-r--r--kernel/locking/lockdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 780012eb2f3f..eead7efbe7e5 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -705,7 +705,7 @@ static void print_lock_name(struct lock_class *class)
printk(KERN_CONT " (");
__print_lock_name(class);
- printk(KERN_CONT "){%s}-{%hd:%hd}", usage,
+ printk(KERN_CONT "){%s}-{%d:%d}", usage,
class->wait_type_outer ?: class->wait_type_inner,
class->wait_type_inner);
}