linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: light: isl76682: remove unreachable code
@ 2023-12-08  2:17 Jiapeng Chong
  2023-12-10 12:37 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2023-12-08  2:17 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jiapeng Chong, Abaci Robot

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>
---
 drivers/iio/light/isl76682.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iio/light/isl76682.c b/drivers/iio/light/isl76682.c
index 0a7c3b09c3c0..cf6ddee44ffc 100644
--- a/drivers/iio/light/isl76682.c
+++ b/drivers/iio/light/isl76682.c
@@ -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)
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: light: isl76682: remove unreachable code
  2023-12-08  2:17 [PATCH] iio: light: isl76682: remove unreachable code Jiapeng Chong
@ 2023-12-10 12:37 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-12-10 12:37 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: lars, linux-iio, linux-kernel, Abaci Robot

On Fri,  8 Dec 2023 10:17:15 +0800
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:

> 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>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/light/isl76682.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iio/light/isl76682.c b/drivers/iio/light/isl76682.c
> index 0a7c3b09c3c0..cf6ddee44ffc 100644
> --- a/drivers/iio/light/isl76682.c
> +++ b/drivers/iio/light/isl76682.c
> @@ -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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-10 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08  2:17 [PATCH] iio: light: isl76682: remove unreachable code Jiapeng Chong
2023-12-10 12:37 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).