public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: class: remove logically dead code
@ 2017-02-15  3:10 Gustavo A. R. Silva
  2017-02-15  8:59 ` Peter Senna Tschudin
  2017-02-15  9:53 ` Oliver Neukum
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-02-15  3:10 UTC (permalink / raw)
  To: gregkh, oneukum, bjorn, robert.foss
  Cc: linux-usb, linux-kernel, Gustavo A. R. Silva,
	Peter Senna Tschudin

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
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 0a63695..8fda45a 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-15  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  3:10 [PATCH] usb: class: remove logically dead code Gustavo A. R. Silva
2017-02-15  8:59 ` Peter Senna Tschudin
2017-02-15  9:53 ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox