]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: light: gp2ap020a00f: correct return type to int
authorEthan Tidmore <ethantidmore06@gmail.com>
Mon, 23 Feb 2026 03:40:12 +0000 (21:40 -0600)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 21:09:06 +0000 (21:09 +0000)
commitb969e76585e9cc3ce0df52e8290841f132a5ea6f
tree089f4c06597695d0468edc499f0ac063767433ec
parent34be156c88080ce1a58d44e409e3ac41ced572c1
iio: light: gp2ap020a00f: correct return type to int

The function gp2ap020a00f_get_thresh_reg() can return -EINVAL in its
error path. Yet, the function has return type of u8. Added error
checking for gp2ap020a00f_get_thresh_reg() return value.

Detected by Smatch:
drivers/iio/light/gp2ap020a00f.c:1013 gp2ap020a00f_get_thresh_reg() warn:
signedness bug returning '(-22)'

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/gp2ap020a00f.c