mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
If 'pin' is not one of its expected values, the value of
'int_out_ctrl_shift' is undefined. With UBSAN enabled, this causes
Clang to generate undefined behavior, resulting in the following
warning:
drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
Prevent the UB and improve error handling by returning an error if 'pin'
has an unexpected value.
While at it, simplify the code a bit by moving the 'pin_name' assignment
to the first switch statement.
Fixes:
|
||
|---|---|---|
| .. | ||
| bmi160_core.c | ||
| bmi160_i2c.c | ||
| bmi160_spi.c | ||
| bmi160.h | ||
| Kconfig | ||
| Makefile | ||