]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: light: isl76682: remove unreachable code
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 8 Dec 2023 02:17:15 +0000 (10:17 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 11 Dec 2023 19:16:35 +0000 (19:16 +0000)
The function isl76682_read_raw cannot execute return -EINVAL up to 145
lines, delete the invalid code.

drivers/iio/light/isl76682.c:145 isl76682_read_raw() warn: ignoring unreachable code.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7698
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20231208021715.32450-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/isl76682.c

index 0a7c3b09c3c057027c1c1ce748bfb461bf2fd62e..cf6ddee44ffc3f8010de912d36d16d474dbdcc66 100644 (file)
@@ -142,7 +142,6 @@ static int isl76682_read_raw(struct iio_dev *indio_dev,
                default:
                        return -EINVAL;
                }
-               return -EINVAL;
        case IIO_CHAN_INFO_SCALE:
                for (i = 0; i < ARRAY_SIZE(isl76682_range_table); i++) {
                        if (chip->range != isl76682_range_table[i].range)