Skip to contentSkip to conversation

USB: sisusbvga: Remove unneeded variable

PATCH Superseded Hariprasad Kelam 2 participants 2 messages Jun 5, 2019

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: sisusbvga: Remove unneeded variable

fix below warning reported by coccicheck

drivers/usb/misc/sisusbvga/sisusb.c:1753:5-8: Unneeded variable: "ret". Return "0" on line 1877

---
 drivers/usb/misc/sisusbvga/sisusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb.c +2 -2
index ea06f1f..dfe2ed1 100644
@@ -1750,7 +1750,7 @@ static int sisusb_setup_screen(struct sisusb_usb_data *sisusb,
 static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb,
 		int touchengines)
 {
-	int ret = 0, i, j, modex, bpp, du;
+	int i, j, modex, bpp, du;
 	u8 sr31, cr63, tmp8;
 	static const char attrdata[] = {
 		0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -1874,7 +1874,7 @@ static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb,
 
 	SETIREG(SISCR, 0x34, 0x44);	/* we just set std mode #44 */
 
-	return ret;
+	return 0;
 }
 
 static int sisusb_init_gfxcore(struct sisusb_usb_data *sisusb)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 24 lines · Hariprasad Kelam

fix below warning reported by coccicheck

drivers/usb/misc/sisusbvga/sisusb.c:1753:5-8: Unneeded variable: "ret". Return "0" on line 1877

---
 drivers/usb/misc/sisusbvga/sisusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/misc/sisusbvga/sisusb.c +1 -1
index ea06f1f..dfe2ed1 100644
@@ -1750,7 +1750,7 @@ static int sisusb_setup_screen(struct sisusb_usb_data *sisusb,
 static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb,
 		int touchengines)
 {
-	int ret = 0, i, j, modex, bpp, du;
+	int i, j, modex, bpp, du;
 	u8 sr31, cr63, tmp8;
 	static const char attrdata[] = {
 		0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,

drivers/usb/misc/sisusbvga/sisusb.c static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb, · line 1877

Quoted 5 lines
drivers/usb/misc/sisusbvga/sisusb.c +1 -1
@@ -1874,7 +1874,7 @@ static int sisusb_set_default_mode(struct sisusb_usb_data *sisusb,
 
 	SETIREG(SISCR, 0x34, 0x44);	/* we just set std mode #44 */
 
-	return ret;
+	return 0;

If this function can not fail, why is it returning anything at all? Please fix that up at the same time.

thanks,

greg k-h