Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1623137 > unrolled thread

[PATCH] staging: rtl8723bs: clean up identical code on an if statement

Started byColin King <colin.king@canonical.com>
First post2017-04-13 17:50 +0200
Last post2017-04-14 14:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: rtl8723bs: clean up identical code on an if statement Colin King <colin.king@canonical.com> - 2017-04-13 17:50 +0200
    Re: [PATCH] staging: rtl8723bs: clean up identical code on an if  statement Hans de Goede <hdegoede@redhat.com> - 2017-04-14 14:20 +0200

#1623137 — [PATCH] staging: rtl8723bs: clean up identical code on an if statement

FromColin King <colin.king@canonical.com>
Date2017-04-13 17:50 +0200
Subject[PATCH] staging: rtl8723bs: clean up identical code on an if statement
Message-ID<tvPaq-4WE-21@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

The two different paths for an if statement are identical and hence
we can just replace it with the single statement.

Detected by CoverityScan, CID#1428443 ("Identical code for
different branches")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 53755e5b97a6..9e355734f0c0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1093,11 +1093,7 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 		rtw_init_bcmc_stainfo(adapter);
 	}
 
-	if (lock_scanned_queue) {
-		find_network(adapter);
-	} else {
-		find_network(adapter);
-	}
+	find_network(adapter);
 
 	if (lock_scanned_queue)
 		adapter->securitypriv.key_mask = 0;
-- 
2.11.0

[toc] | [next] | [standalone]


#1623650 — Re: [PATCH] staging: rtl8723bs: clean up identical code on an if statement

FromHans de Goede <hdegoede@redhat.com>
Date2017-04-14 14:20 +0200
SubjectRe: [PATCH] staging: rtl8723bs: clean up identical code on an if statement
Message-ID<tw8mK-YM-9@gated-at.bofh.it>
In reply to#1623137
Hi,

On 13-04-17 17:46, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The two different paths for an if statement are identical and hence
> we can just replace it with the single statement.
>
> Detected by CoverityScan, CID#1428443 ("Identical code for
> different branches")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans




> ---
>  drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 53755e5b97a6..9e355734f0c0 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -1093,11 +1093,7 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
>  		rtw_init_bcmc_stainfo(adapter);
>  	}
>
> -	if (lock_scanned_queue) {
> -		find_network(adapter);
> -	} else {
> -		find_network(adapter);
> -	}
> +	find_network(adapter);
>
>  	if (lock_scanned_queue)
>  		adapter->securitypriv.key_mask = 0;
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web