Skip to contentSkip to conversation

usb: class: remove logically dead code

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Feb 15, 2017 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: class: remove logically dead code

Remove logically dead code.
'cntr' is always equal to zero when the following line of code is executed:
rv = cntr ? cntr : -EAGAIN;

Addresses-Coverity-ID: 113227

---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-wdm.c +1 -1
index 0a63695..8fda45a 100644
@@ -531,7 +531,7 @@ static ssize_t wdm_read
 		i++;
 		if (file->f_flags & O_NONBLOCK) {
 			if (!test_bit(WDM_READ, &desc->flags)) {
-				rv = cntr ? cntr : -EAGAIN;
+				rv = -EAGAIN;
 				goto err;
 			}
 			rv = 0;
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

Remove logically dead code.
'cntr' is always equal to zero when the following line of code is executed:
rv = cntr ? cntr : -EAGAIN;

Addresses-Coverity-ID: 113227

Quoted 20 lines
---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-wdm.c +1 -1
index 0a63695..8fda45a 100644
@@ -531,7 +531,7 @@ static ssize_t wdm_read
 		i++;
 		if (file->f_flags & O_NONBLOCK) {
 			if (!test_bit(WDM_READ, &desc->flags)) {
-				rv = cntr ? cntr : -EAGAIN;
+				rv = -EAGAIN;
 				goto err;
 			}
 			rv = 0;
Signature · 1 line
2.5.0