Skip to contentSkip to conversation

iio: pressure: rohm-bm1390: Remove redundant if statement

PATCH Applied Colin Ian King 3 participants 3 messages Oct 10, 2024 – Oct 11, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: pressure: rohm-bm1390: Remove redundant if statement

From: Colin Ian King <[email protected]>

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.

---
 drivers/iio/pressure/rohm-bm1390.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iio/pressure/rohm-bm1390.c +0 -3
index ccaa07a569c9..f24d9f927681 100644
@@ -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)
 {
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw
Quoted 7 lines · On Thu, 10 Oct 2024 18:08:35 +0100 Colin Ian King <[email protected]>…

From: Colin Ian King <[email protected]>

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.

Applied. Thanks,

Jonathan

Quoted 32 lines
---
 drivers/iio/pressure/rohm-bm1390.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iio/pressure/rohm-bm1390.c +0 -3
index ccaa07a569c9..f24d9f927681 100644
@@ -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)
 {