* [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement
@ 2024-10-10 17:08 Colin Ian King
2024-10-10 18:07 ` Jonathan Cameron
2024-10-11 9:38 ` Matti Vaittinen
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2024-10-10 17:08 UTC (permalink / raw)
To: Matti Vaittinen, Jonathan Cameron, Lars-Peter Clausen, linux-iio
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.i.king@intel.com>
There is a check on non-zero ret that is redundant because the
same check is being performed in a previous if statement and
also before that. The check is not required, remove it.
Signed-off-by: Colin Ian King <colin.i.king@intel.com>
---
drivers/iio/pressure/rohm-bm1390.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/iio/pressure/rohm-bm1390.c b/drivers/iio/pressure/rohm-bm1390.c
index ccaa07a569c9..f24d9f927681 100644
--- a/drivers/iio/pressure/rohm-bm1390.c
+++ b/drivers/iio/pressure/rohm-bm1390.c
@@ -410,23 +410,20 @@ static int __bm1390_fifo_flush(struct iio_dev *idev, unsigned int samples,
if (ret)
return ret;
if (test_bit(BM1390_CHAN_TEMP, idev->active_scan_mask)) {
ret = regmap_bulk_read(data->regmap, BM1390_REG_TEMP_HI, &temp,
sizeof(temp));
if (ret)
return ret;
}
- if (ret)
- return ret;
-
for (i = 0; i < smp_lvl; i++) {
buffer[i].temp = temp;
iio_push_to_buffers(idev, &buffer[i]);
}
return smp_lvl;
}
static int bm1390_fifo_flush(struct iio_dev *idev, unsigned int samples)
{
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement
2024-10-10 17:08 [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement Colin Ian King
@ 2024-10-10 18:07 ` Jonathan Cameron
2024-10-11 9:38 ` Matti Vaittinen
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-10-10 18:07 UTC (permalink / raw)
To: Colin Ian King
Cc: Matti Vaittinen, Lars-Peter Clausen, linux-iio, kernel-janitors,
linux-kernel
On Thu, 10 Oct 2024 18:08:35 +0100
Colin Ian King <colin.i.king@gmail.com> wrote:
> From: Colin Ian King <colin.i.king@intel.com>
>
> There is a check on non-zero ret that is redundant because the
> same check is being performed in a previous if statement and
> also before that. The check is not required, remove it.
>
> Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Applied. Thanks,
Jonathan
> ---
> drivers/iio/pressure/rohm-bm1390.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/iio/pressure/rohm-bm1390.c b/drivers/iio/pressure/rohm-bm1390.c
> index ccaa07a569c9..f24d9f927681 100644
> --- a/drivers/iio/pressure/rohm-bm1390.c
> +++ b/drivers/iio/pressure/rohm-bm1390.c
> @@ -410,23 +410,20 @@ static int __bm1390_fifo_flush(struct iio_dev *idev, unsigned int samples,
> if (ret)
> return ret;
>
> if (test_bit(BM1390_CHAN_TEMP, idev->active_scan_mask)) {
> ret = regmap_bulk_read(data->regmap, BM1390_REG_TEMP_HI, &temp,
> sizeof(temp));
> if (ret)
> return ret;
> }
>
> - if (ret)
> - return ret;
> -
> for (i = 0; i < smp_lvl; i++) {
> buffer[i].temp = temp;
> iio_push_to_buffers(idev, &buffer[i]);
> }
>
> return smp_lvl;
> }
>
> static int bm1390_fifo_flush(struct iio_dev *idev, unsigned int samples)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement
2024-10-10 17:08 [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement Colin Ian King
2024-10-10 18:07 ` Jonathan Cameron
@ 2024-10-11 9:38 ` Matti Vaittinen
1 sibling, 0 replies; 3+ messages in thread
From: Matti Vaittinen @ 2024-10-11 9:38 UTC (permalink / raw)
To: Colin Ian King, Jonathan Cameron, Lars-Peter Clausen, linux-iio
Cc: kernel-janitors, linux-kernel
On 10/10/2024 20:08, Colin Ian King wrote:
> From: Colin Ian King <colin.i.king@intel.com>
>
> There is a check on non-zero ret that is redundant because the
> same check is being performed in a previous if statement and
> also before that. The check is not required, remove it.
>
> Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-11 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-10 17:08 [PATCH][next] iio: pressure: rohm-bm1390: Remove redundant if statement Colin Ian King
2024-10-10 18:07 ` Jonathan Cameron
2024-10-11 9:38 ` Matti Vaittinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®