linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 2/5] staging: r8188eu: use support_ant_div()
Date: Sun,  3 Apr 2022 18:52:52 +0200	[thread overview]
Message-ID: <20220403165255.6900-3-straube.linux@gmail.com> (raw)
In-Reply-To: <20220403165255.6900-1-straube.linux@gmail.com>

Use support_ant_div() instead of checking haldata->AntDivCfg directly.
This improves readability and makes future cleanups, e.g. removing the
hal_data_8188e structure, easier.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/hal/rtl8188e_dm.c | 8 +++-----
 drivers/staging/r8188eu/hal/usb_halinit.c | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index 6d28e3dc0d26..d69327f361aa 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -33,7 +33,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	int i;
 
 	pdmpriv->InitODMFlag = ODM_BB_RSSI_MONITOR;
-	if (hal_data->AntDivCfg)
+	if (support_ant_div(Adapter))
 		pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
 
 	dm_odm->SupportAbility = pdmpriv->InitODMFlag;
@@ -102,9 +102,7 @@ void rtl8188e_init_dm_priv(struct adapter *Adapter)
 /*  Compare RSSI for deciding antenna */
 void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
 {
-	struct hal_data_8188e *hal_data = &Adapter->haldata;
-
-	if (0 != hal_data->AntDivCfg) {
+	if (support_ant_div(Adapter)) {
 		/* select optimum_antenna for before linked =>For antenna diversity */
 		if (dst->Rssi >=  src->Rssi) {/* keep org parameter */
 			src->Rssi = dst->Rssi;
@@ -122,7 +120,7 @@ u8 AntDivBeforeLink8188E(struct adapter *Adapter)
 	struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
 
 	/*  Condition that does not need to use antenna diversity. */
-	if (hal_data->AntDivCfg == 0)
+	if (!support_ant_div(Adapter))
 		return false;
 
 	if (check_fwstate(pmlmepriv, _FW_LINKED))
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 31ec88b7a400..e5b352671ea4 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -492,7 +492,7 @@ static void _InitAntenna_Selection(struct adapter *Adapter)
 {
 	struct hal_data_8188e *haldata = &Adapter->haldata;
 
-	if (haldata->AntDivCfg == 0)
+	if (!support_ant_div(Adapter))
 		return;
 
 	rtw_write32(Adapter, REG_LEDCFG0, rtw_read32(Adapter, REG_LEDCFG0) | BIT(23));
-- 
2.35.1


  parent reply	other threads:[~2022-04-03 16:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 16:52 [PATCH 0/5] staging: r8188eu: remove GetHalDefVar8188EUsb() Michael Straube
2022-04-03 16:52 ` [PATCH 1/5] staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIV Michael Straube
2022-04-04 14:32   ` Greg KH
2022-04-05  9:07     ` Michael Straube
2022-04-03 16:52 ` Michael Straube [this message]
2022-04-03 16:52 ` [PATCH 3/5] staging: r8188eu: remove dead code Michael Straube
2022-04-03 16:52 ` [PATCH 4/5] staging: r8188eu: remove HAL_DEF_CURRENT_ANTENNA Michael Straube
2022-04-03 16:52 ` [PATCH 5/5] staging: r8188eu: remove GetHalDefVar8188EUsb() Michael Straube

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220403165255.6900-3-straube.linux@gmail.com \
    --to=straube.linux@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).