linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath6kl: remove redundant check of status != 0
@ 2019-04-04 13:47 Colin King
  2019-04-04 14:33 ` Kalle Valo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2019-04-04 13:47 UTC (permalink / raw)
  To: Kalle Valo, David S . Miller, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 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


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

* Re: [PATCH] ath6kl: remove redundant check of status != 0
  2019-04-04 13:47 [PATCH] ath6kl: remove redundant check of status != 0 Colin King
@ 2019-04-04 14:33 ` Kalle Valo
  2019-04-05  6:50 ` Mukesh Ojha
  2019-04-29 14:50 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-04-04 14:33 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> writes:

> From: Colin Ian King <colin.king@canonical.com>
>
> 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

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

* Re: [PATCH] ath6kl: remove redundant check of status != 0
  2019-04-04 13:47 [PATCH] ath6kl: remove redundant check of status != 0 Colin King
  2019-04-04 14:33 ` Kalle Valo
@ 2019-04-05  6:50 ` Mukesh Ojha
  2019-04-29 14:50 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Ojha @ 2019-04-05  6:50 UTC (permalink / raw)
  To: Colin King, Kalle Valo, David S . Miller, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel


On 4/4/2019 7:17 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>


Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

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;

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

* Re: [PATCH] ath6kl: remove redundant check of status != 0
  2019-04-04 13:47 [PATCH] ath6kl: remove redundant check of status != 0 Colin King
  2019-04-04 14:33 ` Kalle Valo
  2019-04-05  6:50 ` Mukesh Ojha
@ 2019-04-29 14:50 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-04-29 14:50 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> 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 <colin.king@canonical.com>
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

e643da21e19a ath6kl: remove redundant check of status != 0

-- 
https://patchwork.kernel.org/patch/10885625/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2019-04-29 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 13:47 [PATCH] ath6kl: remove redundant check of status != 0 Colin King
2019-04-04 14:33 ` Kalle Valo
2019-04-05  6:50 ` Mukesh Ojha
2019-04-29 14:50 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).