Re: [PATCH] usb: class: remove logically dead code

2017-02-15 Thread Oliver Neukum
Am Dienstag, den 14.02.2017, 21:10 -0600 schrieb 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
> Signed-off-by: Gustavo A. R. Silva 
> 
Acked-by: Oliver Neukum 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: class: remove logically dead code

2017-02-15 Thread Peter Senna Tschudin
On Tue, Feb 14, 2017 at 09:10:52PM -0600, Gustavo A. R. Silva wrote:
> 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 
Reviewed-by: Peter Senna Tschudin 
> ---
>  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, >flags)) {
> - rv = cntr ? cntr : -EAGAIN;
> + rv = -EAGAIN;
>   goto err;
>   }
>   rv = 0;
> -- 
> 2.5.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: class: remove logically dead code

2017-02-14 Thread 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
Signed-off-by: Gustavo A. R. Silva 
---
 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, >flags)) {
-   rv = cntr ? cntr : -EAGAIN;
+   rv = -EAGAIN;
goto err;
}
rv = 0;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html