Skip to contentSkip to conversation

drivers/usb/misc/sisusbvga/sisusb.c: remove dead code

PATCH In review Adrian Bunk 3 participants 6 messages Nov 20, 2005 – Nov 29, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/usb/misc/sisusbvga/sisusb.c: remove dead code

The Coverity checker found this obviously dead code.

---

 drivers/usb/misc/sisusbvga/sisusb.c |    6 ------
 1 file changed, 6 deletions(-)
drivers/usb/misc/sisusbvga/sisusb.c renamed from drivers/usb/misc/sisusbvga/sisusb.c.old +0 -6
@@ -861,13 +861,10 @@
 
 	while (length) {
 
 	    switch (length) {
 
-		case 0:
-			return ret;
-
 		case 1:
 			if (userbuffer) {
 				if (get_user(swap8, (u8 __user *)userbuffer))
 					return -EFAULT;
 			} else
@@ -1219,13 +1216,10 @@
 
 	while (length) {
 
 	    switch (length) {
 
-		case 0:
-			return ret;
-
 		case 1:
 
 			ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM,
 								addr, &buf[0]);
 			if (!ret) {
#1 lore raw
Quoted 1 line · Adrian Bunk

The Coverity checker found this obviously dead code.

I think the checker is wrong, this does not look correct to me.

thanks,

greg k-h

#2 lore raw
Quoted 4 lines · Greg KH
Quoted 1 line · Adrian Bunk

The Coverity checker found this obviously dead code.

I think the checker is wrong, this does not look correct to me.

Why?

Due to the while(length), length can't be 0 at the switch.

Quoted 3 lines

thanks,

greg k-h

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 9 lines · Adrian Bunk
Quoted 4 lines · Greg KH
Quoted 1 line · Adrian Bunk

The Coverity checker found this obviously dead code.

I think the checker is wrong, this does not look correct to me.

Why?

Due to the while(length), length can't be 0 at the switch.

Doh, ok, nevermind. Care to resend this?

thanks,

greg k-h

#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Greg KH
Quoted 6 lines · Adrian Bunk
Quoted 4 lines · Greg KH
Quoted 1 line · Adrian Bunk

The Coverity checker found this obviously dead code.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I think the checker is wrong, this does not look correct to me.

Why?

Due to the while(length), length can't be 0 at the switch.

Doh, ok, nevermind. Care to resend this?

Took me also a few seconds to realize that the tool is correct. Nice stuff.

Thomas

- --
Thomas Winischhofer
Vienna/Austria
thomas AT winischhofer DOT net *** http://www.winischhofer.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDjCx8zydIRAktyUcRAi8NAKCA96Bt9ibOIRGQWhSUy6qnd5QxYwCeLtHE VvGqTMgnn476dnm/PYKBSM8=
=3eHZ
-----END PGP SIGNATURE-----

#5 lore raw

PATCH 1/1 drivers/usb/misc/sisusbvga/sisusb.c: remove dead code

In reply to Greg KH
Quoted 5 lines · Greg KH
Quoted 4 lines · Adrian Bunk
Quoted 3 lines · Greg KH
Quoted 1 line · Adrian Bunk

The Coverity checker found this obviously dead code.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

I think the checker is wrong, this does not look correct to me.

Why?

Due to the while(length), length can't be 0 at the switch.

Doh, ok, nevermind. Care to resend this?

It's below.

Quoted 3 lines

thanks,

greg k-h

cu
Adrian

<-- snip -->

The Coverity checker found this dead code.

---

 drivers/usb/misc/sisusbvga/sisusb.c |    6 ------
 1 file changed, 6 deletions(-)
drivers/usb/misc/sisusbvga/sisusb.c renamed from drivers/usb/misc/sisusbvga/sisusb.c.old +0 -6
@@ -861,13 +861,10 @@
 
 	while (length) {
 
 	    switch (length) {
 
-		case 0:
-			return ret;
-
 		case 1:
 			if (userbuffer) {
 				if (get_user(swap8, (u8 __user *)userbuffer))
 					return -EFAULT;
 			} else
@@ -1219,13 +1216,10 @@
 
 	while (length) {
 
 	    switch (length) {
 
-		case 0:
-			return ret;
-
 		case 1:
 
 			ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM,
 								addr, &buf[0]);
 			if (!ret) {