Skip to contentSkip to conversation

drivers: uio: remove redundant assignment to variable retval

PATCH New Colin King 1 participant 1 message Apr 25, 2020

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drivers: uio: remove redundant assignment to variable retval

From: Colin Ian King <[email protected]>

The variable retval is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/uio/uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/uio/uio.c +1 -1
index 6e725c6c6256..73efb80815db 100644
@@ -398,7 +398,7 @@ static void uio_dev_del_attributes(struct uio_device *idev)
 
 static int uio_get_minor(struct uio_device *idev)
 {
-	int retval = -ENOMEM;
+	int retval;
 
 	mutex_lock(&minor_lock);
 	retval = idr_alloc(&uio_idr, idev, 0, UIO_MAX_DEVICES, GFP_KERNEL);
Signature · 1 line
2.25.1