Skip to contentSkip to conversation

iio: buffer: remove unneeded test

PATCH Applied Laurent Navet 2 participants 2 messages May 30, 2015 – Jun 1, 2015 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: buffer: remove unneeded test

The same code is executed regardless ret value, so this test can be removed.
Also fix coverity scan CID 1268786.

---
 drivers/iio/industrialio-buffer.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/industrialio-buffer.c +0 -2
index df919f4..e7fbcce 100644
@@ -806,8 +806,6 @@ static ssize_t iio_buffer_store_enable(struct device *dev,
 		ret = __iio_update_buffers(indio_dev,
 					 NULL, indio_dev->buffer);
 
-	if (ret < 0)
-		goto done;
 done:
 	mutex_unlock(&indio_dev->mlock);
 	return (ret < 0) ? ret : len;
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 5 lines · Laurent Navet

The same code is executed regardless ret value, so this test can be removed.
Also fix coverity scan CID 1268786.

Applied to the togreg branch of iio.git. Will push out as testing when not stuck in a cleanroom with no net access (but curiously with my less than entirely clean laptop ;)

Jonathan

Quoted 18 lines
---
 drivers/iio/industrialio-buffer.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/industrialio-buffer.c +0 -2
index df919f4..e7fbcce 100644
@@ -806,8 +806,6 @@ static ssize_t iio_buffer_store_enable(struct device *dev,
 		ret = __iio_update_buffers(indio_dev,
 					 NULL, indio_dev->buffer);
 
-	if (ret < 0)
-		goto done;
 done:
 	mutex_unlock(&indio_dev->mlock);
 	return (ret < 0) ? ret : len;