[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190523121927.28806-1-nishkadg.linux@gmail.com>
Date: Thu, 23 May 2019 17:49:27 +0530
From: Nishka Dasgupta <nishkadg.linux@...il.com>
To: gregkh@...uxfoundation.org, straube.linux@...il.com,
realwakka@...il.com, hle@....eu.com, rico.schrage@...il.com,
sophie.matter@....de, jbi.octave@...il.com,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc: Nishka Dasgupta <nishka.dasgupta@...oo.com>
Subject: [PATCH] staging: pi433: Remove unnecessary return variable
From: Nishka Dasgupta <nishka.dasgupta@...oo.com>
The variable retval is initialised to 0 and assigned a constant value
later. Both of these can be returned separately, hence retval can be
removed.
Signed-off-by: Nishka Dasgupta <nishka.dasgupta@...oo.com>
---
drivers/staging/pi433/pi433_if.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index c889f0bdf424..40c6f4e7632f 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -871,7 +871,6 @@ pi433_write(struct file *filp, const char __user *buf,
static long
pi433_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
- int retval = 0;
struct pi433_instance *instance;
struct pi433_device *device;
struct pi433_tx_cfg tx_cfg;
@@ -923,10 +922,10 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
mutex_unlock(&device->rx_lock);
break;
default:
- retval = -EINVAL;
+ return -EINVAL;
}
- return retval;
+ return 0;
}
#ifdef CONFIG_COMPAT
--
2.19.1
Powered by blists - more mailing lists