2019-04-04 13:48:20

by Colin King

[permalink] [raw]
Subject: [PATCH] ath6kl: remove redundant check of status != 0

From: Colin Ian King <[email protected]>

The check on status not being zero is redundant as previous code
paths that set status to an error value break out of the while
loop and hence status is never non-zero at the check. Remove
this redundant code.

Addresses-Coverity: ("Logically dead code")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/net/wireless/ath/ath6kl/htc_pipe.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index 434b66829646..c68848819a52 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -898,9 +898,6 @@ static int htc_process_trailer(struct htc_target *target, u8 *buffer,
break;
}

- if (status != 0)
- break;
-
/* advance buffer past this record for next time around */
buffer += record->len;
len -= record->len;
--
2.20.1


2019-04-04 14:34:33

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath6kl: remove redundant check of status != 0

Colin King <[email protected]> writes:

> From: Colin Ian King <[email protected]>
>
> The check on status not being zero is redundant as previous code
> paths that set status to an error value break out of the while
> loop and hence status is never non-zero at the check. Remove
> this redundant code.
>
> Addresses-Coverity: ("Logically dead code")

Is the coverity id missing?

--
Kalle Valo

2019-04-05 06:51:27

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH] ath6kl: remove redundant check of status != 0


On 4/4/2019 7:17 PM, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The check on status not being zero is redundant as previous code
> paths that set status to an error value break out of the while
> loop and hence status is never non-zero at the check. Remove
> this redundant code.
>
> Addresses-Coverity: ("Logically dead code")
> Signed-off-by: Colin Ian King <[email protected]>


Reviewed-by: Mukesh Ojha <[email protected]>

Cheers,
-Mukesh

> ---
> drivers/net/wireless/ath/ath6kl/htc_pipe.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
> index 434b66829646..c68848819a52 100644
> --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
> +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
> @@ -898,9 +898,6 @@ static int htc_process_trailer(struct htc_target *target, u8 *buffer,
> break;
> }
>
> - if (status != 0)
> - break;
> -
> /* advance buffer past this record for next time around */
> buffer += record->len;
> len -= record->len;