Skip to contentSkip to conversation

staging: pi433: Remove unnecessary return variable

PATCH Superseded Nishka Dasgupta 1 participant 1 message May 23, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: pi433: Remove unnecessary return variable

From: Nishka Dasgupta <[email protected]>

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.

---
 drivers/staging/pi433/pi433_if.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/pi433/pi433_if.c +2 -3
index c889f0bdf424..40c6f4e7632f 100644
@@ -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
Signature · 1 line
2.19.1