Skip to contentSkip to conversation

media: pwc-ctl: remove redundant assignment to variable ret

PATCH In review Colin King 2 participants 2 messages Apr 10, 2020 – Apr 11, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 media: pwc-ctl: remove redundant assignment to variable ret

From: Colin Ian King <[email protected]>

The variable ret 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/media/usb/pwc/pwc-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/pwc/pwc-ctrl.c +1 -1
index 315c55927f5c..cff64d872058 100644
@@ -523,7 +523,7 @@ int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
 #ifdef CONFIG_USB_PWC_DEBUG
 int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
 {
-	int ret = -1, request;
+	int ret, request;
 
 	if (pdev->type < 675)
 		request = SENSOR_TYPE_FORMATTER1;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The variable ret 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")

Quoted 20 lines
---
 drivers/media/usb/pwc/pwc-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/pwc/pwc-ctrl.c +1 -2
index 315c55927f5c..cff64d872058 100644
@@ -523,7 +523,7 @@ int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
 #ifdef CONFIG_USB_PWC_DEBUG
 int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
 {
-       int ret = -1, request;
+       int ret, request;
 
        if (pdev->type < 675)
                request = SENSOR_TYPE_FORMATTER1;
--

2.25.1