drivers: staging: iio: meter: Removed unnecessary variable

Author: Tina Johnson <tinajohnson.1234@gmail.com>

Variable ret is used only to store the error code to be returned.
Hence use of ret is removed and the return statement modified.
Coccinelle was used to prepare the patch:

@rule1@
identifier ret;
expression e;
@@

-ret =
+return
        e;
-return ret;

Signed-off-by: Tina Johnson 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/iio/meter/ade7758_ring.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
index 3792b57..9725a04 100644
--- a/drivers/staging/iio/meter/ade7758_ring.c
+++ b/drivers/staging/iio/meter/ade7758_ring.c
@@ -120,8 +120,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev)
 
 	buffer = iio_kfifo_allocate();
 	if (!buffer) {
-		ret = -ENOMEM;
-		return ret;
+		return -ENOMEM;
 	}
 
 	iio_device_attach_buffer(indio_dev, buffer);
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.