summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorJustin Stitt <justinstitt@google.com>2022-07-12 00:29:32 +0300
committerKalle Valo <kvalo@kernel.org>2022-07-18 14:54:23 +0300
commit68204a696505fe97150d498f32e38c2a926c540f (patch)
treece18e3d188226495213819f7b6bbd9815c23f123 /tools/perf/scripts/python/exported-sql-viewer.py
parent07db88f11e63d78c5062447faf942745ce8959ff (diff)
downloadlinux-68204a696505fe97150d498f32e38c2a926c540f.tar.xz
wifi: mt7601u: fix clang -Wformat warning
When building with Clang we encounter this warning: | drivers/net/wireless/mediatek/mt7601u/debugfs.c:92:6: error: format | specifies type 'unsigned char' but the argument has type 'int' | [-Werror,-Wformat] dev->ee->reg.start + dev->ee->reg.num - 1); The format specifier used is `%hhu` which describes a u8. Both `dev->ee->reg.start` and `.num` are u8 as well. However, the expression as a whole is promoted to an int as you cannot get smaller-than-int from addition. Therefore, to fix the warning, use the promoted-to-type's format specifier -- in this case `%d`. example: ``` uint8_t a = 4, b = 7; int size = sizeof(a + b - 1); printf("%d\n", size); // output: 4 ``` See more: (https://wiki.sei.cmu.edu/confluence/display/c/INT02-C.+Understand+integer+conversion+rules) "Integer types smaller than int are promoted when an operation is performed on them. If all values of the original type can be represented as an int, the value of the smaller type is converted to an int; otherwise, it is converted to an unsigned int." Signed-off-by: Justin Stitt <justinstitt@google.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220711212932.1501592-1-justinstitt@google.com
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions