aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/timerlist.py
diff options
context:
space:
mode:
authorMasahiro Yamada <[email protected]>2019-06-06 17:52:42 +0900
committerGuenter Roeck <[email protected]>2019-06-23 18:33:01 -0700
commit5fe625c136367fc7283d021d3ae574fce060d716 (patch)
treea80c67ce4b4669a26446d065bb25741a7cb1be27 /scripts/gdb/linux/timerlist.py
parent9158411b96b14d9d448e978b0fc8a1cffcb8a1c6 (diff)
hwmon: (smsc47m1) fix (suspicious) outside array bounds warnings
Kbuild test robot reports outside array bounds warnings. This is reproducible for ARCH=sh allmodconfig with the kernel.org toolchains available at: https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-sh4-linux.tar.xz CC [M] drivers/hwmon/smsc47m1.o drivers/hwmon/smsc47m1.c: In function 'fan_div_store': drivers/hwmon/smsc47m1.c:370:49: warning: array subscript [0, 2] is outside array bounds of 'u8[3]' {aka 'unsigned char[3]'} [-Warray-bounds] tmp = 192 - (old_div * (192 - data->fan_preload[nr]) ~~~~~~~~~~~~~~~~~^~~~ drivers/hwmon/smsc47m1.c:372:19: warning: array subscript [0, 2] is outside array bounds of 'u8[3]' {aka 'unsigned char[3]'} [-Warray-bounds] data->fan_preload[nr] = clamp_val(tmp, 0, 191); ~~~~~~~~~~~~~~~~~^~~~ drivers/hwmon/smsc47m1.c:373:53: warning: array subscript [0, 2] is outside array bounds of 'const u8[3]' {aka 'const unsigned char[3]'} [-Warray-bounds] smsc47m1_write_value(data, SMSC47M1_REG_FAN_PRELOAD[nr], ~~~~~~~~~~~~~~~~~~~~~~~~^~~~ Looking at the code, I believe these are false positives. While it is ridiculous to patch our driver to make the insane compiler happy, clarifying the unreachable path will be helpful not only for compilers but also for humans. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> [groeck: Use BUG() instead of unreachable() to make objtool happy] Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions