LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] staging: pi433: Remove unnecessary return variable
@ 2019-05-23 12:19 Nishka Dasgupta
0 siblings, 0 replies; only message in thread
From: Nishka Dasgupta @ 2019-05-23 12:19 UTC (permalink / raw)
To: gregkh, straube.linux, realwakka, hle, rico.schrage,
sophie.matter, jbi.octave, devel, linux-kernel
Cc: Nishka Dasgupta
From: Nishka Dasgupta <nishka.dasgupta@yahoo.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@yahoo.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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-23 12:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 12:19 [PATCH] staging: pi433: Remove unnecessary return variable Nishka Dasgupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).