2015-01-13 14:08:42

by Colin King

[permalink] [raw]
Subject: [PATCH] rtlwifi/rtl8192de: remove redundant else if check

From: Colin Ian King <[email protected]>

The else if check condition checks for the opposite of the
if check, hence the else if check is redundant and can be
replaced with a simple else:

if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
..
} else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
..
}

replaced with:

if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
..
} else {
..
}

Signed-off-by: Colin Ian King <[email protected]>
---
drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 280c3da..01bcc2d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -546,7 +546,7 @@ static bool _rtl92de_llt_table_init(struct ieee80211_hw *hw)
txpktbuf_bndy = 246;
value8 = 0;
value32 = 0x80bf0d29;
- } else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
+ } else {
maxPage = 127;
txpktbuf_bndy = 123;
value8 = 0;
--
2.1.4



2015-01-23 17:31:01

by Kalle Valo

[permalink] [raw]
Subject: Re: rtlwifi/rtl8192de: remove redundant else if check


> From: Colin Ian King <[email protected]>
>
> The else if check condition checks for the opposite of the
> if check, hence the else if check is redundant and can be
> replaced with a simple else:
>
> if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
> ..
> } else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
> ..
> }
>
> replaced with:
>
> if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
> ..
> } else {
> ..
> }
>
> Signed-off-by: Colin Ian King <[email protected]>
> Acked-by: Larry Finger <[email protected]>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

2015-01-13 17:19:41

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi/rtl8192de: remove redundant else if check

On 01/13/2015 08:07 AM, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The else if check condition checks for the opposite of the
> if check, hence the else if check is redundant and can be
> replaced with a simple else:
>
> if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
> ..
> } else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
> ..
> }
>
> replaced with:
>
> if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
> ..
> } else {
> ..
> }
>
> Signed-off-by: Colin Ian King <[email protected]>

Acked-by: Larry Finger <[email protected]>

Thanks,

Larry

> ---
> drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> index 280c3da..01bcc2d 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> @@ -546,7 +546,7 @@ static bool _rtl92de_llt_table_init(struct ieee80211_hw *hw)
> txpktbuf_bndy = 246;
> value8 = 0;
> value32 = 0x80bf0d29;
> - } else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
> + } else {
> maxPage = 127;
> txpktbuf_bndy = 123;
> value8 = 0;
>