public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Prithvi Tambewagh <activprithvi@gmail.com>,
	gregkh@linuxfoundation.org, abrahamadekunle50@gmail.com,
	b9788213@gmail.com, straube.linux@gmail.com,
	ethantidmore06@gmail.com, andriy.shevchenko@linux.intel.com,
	dan.carpenter@linaro.org, weibu@redadmin.org,
	knavaneeth786@gmail.com, ignacio.pena87@gmail.com,
	dharanitharan725@gmail.com, samasth.norway.ananda@oracle.com,
	karanja99erick@gmail.com, s9430939@naver.com,
	suunj1331@gmail.com, ysinghcin@gmail.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
	david.hunter.linux@gmail.com, khalid@kernel.org
Subject: Re: [RFT PATCH v3 1/5] staging: rtl8723bs: move constant to right side of test in comparison
Date: Sun, 05 Apr 2026 14:51:29 +0200	[thread overview]
Message-ID: <F31C7F72-D267-450E-81FA-DAA3F14FDEE9@linux.dev> (raw)
In-Reply-To: <20260405114132.310774-2-activprithvi@gmail.com>

On April 5, 2026 1:41:28 PM GMT+02:00, Prithvi Tambewagh <activprithvi@gmail.com> wrote:
>Move constant from the left side to the right side of the test in a
>comparison, where ==, !=, <=, >=, <, > operators are used, fixing the
>checkpatch warning: Comparisons should place the constant on the right
>side of the test.
>
>Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
>---
> .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c    |  4 ++--
> drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c |  2 +-
> drivers/staging/rtl8723bs/hal/hal_com.c        |  2 +-
> drivers/staging/rtl8723bs/hal/hal_com_phycfg.c |  4 ++--
> .../staging/rtl8723bs/hal/rtl8723b_hal_init.c  | 18 +++++++++---------
> drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c |  2 +-
> drivers/staging/rtl8723bs/include/ieee80211.h  |  4 ++--
> 7 files changed, 18 insertions(+), 18 deletions(-)
>
>diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
>index d32dbf94858f..58f6cf063498 100644
>--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
>+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
>@@ -2211,7 +2211,7 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
> 	}
> 
> 	algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist);
>-	if (pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS != algorithm)) {
>+	if (pCoexSta->bC2hBtInquiryPage && (algorithm != BT_8723B_2ANT_COEX_ALGO_PANHS)) {
> 		halbtc8723b2ant_ActionBtInquiry(pBtCoexist);
> 		return;
> 	} else {
>@@ -2490,7 +2490,7 @@ void EXhalbtc8723b2ant_BtInfoNotify(
> 		return;
> 	}
> 
>-	if (BT_INFO_SRC_8723B_2ANT_WIFI_FW != rspSource) {
>+	if (rspSource != BT_INFO_SRC_8723B_2ANT_WIFI_FW) {
> 		pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2] & 0xf; /* [3:0] */
> 
> 		pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 + 10;
>diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
>index 9df3274c1048..9e7eebfc02a9 100644
>--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
>+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
>@@ -313,7 +313,7 @@ static void GetDeltaSwingTable_8723B(
> 	u16 rate = *(pDM_Odm->pForcedDataRate);
> 	u8 channel = pHalData->CurrentChannel;
> 
>-	if (1 <= channel && channel <= 14) {
>+	if (channel >= 1 && channel <= 14) {
> 		if (IS_CCK_RATE(rate)) {
> 			*TemperatureUP_A   = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P;
> 			*TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N;
>diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
>index 31b3e880ae6a..597ba3d283c1 100644
>--- a/drivers/staging/rtl8723bs/hal/hal_com.c
>+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
>@@ -107,7 +107,7 @@ u8 hal_com_config_channel_plan(
> 	pHalData->bDisableSWChannelPlan = false;
> 	chnlPlan = def_channel_plan;
> 
>-	if (0xFF == hw_channel_plan)
>+	if (hw_channel_plan == 0xFF)
> 		AutoLoadFail = true;
> 
> 	if (!AutoLoadFail) {
>diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
>index dc2da49e6738..9e523491a008 100644
>--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
>+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
>@@ -462,11 +462,11 @@ u8 PHY_GetTxPowerIndexBase(
> 
> 	if (IS_CCK_RATE(Rate))
> 		txPower = pHalData->Index24G_CCK_Base[RFPath][chnlIdx];
>-	else if (MGN_6M <= Rate)
>+	else if (Rate >= MGN_6M)
> 		txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx];
> 
> 	/*  OFDM-1T */
>-	if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
>+	if ((Rate >= MGN_6M && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
> 		txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S];
> 
> 	if (BandWidth == CHANNEL_WIDTH_20) { /*  BW20-1S, BW20-2S */
>diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
>index 8d259820f103..02c3f4229e74 100644
>--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
>+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
>@@ -405,11 +405,11 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool  bUsedWoWLANFw)
> 			break;
> 	}
> 	_FWDownloadEnable(padapter, false);
>-	if (_SUCCESS != rtStatus)
>+	if (rtStatus != _SUCCESS)
> 		goto fwdl_stat;
> 
> 	rtStatus = _FWFreeToGo(padapter, 10, 200);
>-	if (_SUCCESS != rtStatus)
>+	if (rtStatus != _SUCCESS)
> 		goto fwdl_stat;
> 
> fwdl_stat:
>@@ -1165,15 +1165,15 @@ s32 rtl8723b_InitLLTTable(struct adapter *padapter)
> 
> static void hal_get_chnl_group_8723b(u8 channel, u8 *group)
> {
>-	if (1  <= channel && channel <= 2)
>+	if (channel >= 1 && channel <= 2)
> 		*group = 0;
>-	else if (3  <= channel && channel <= 5)
>+	else if (channel >= 3 && channel <= 5)
> 		*group = 1;
>-	else if (6  <= channel && channel <= 8)
>+	else if (channel >= 6 && channel <= 8)
> 		*group = 2;
>-	else if (9  <= channel && channel <= 11)
>+	else if (channel >= 9 && channel <= 11)
> 		*group = 3;
>-	else if (12 <= channel && channel <= 14)
>+	else if (channel >= 12 && channel <= 14)
> 		*group = 4;
> }
> 
>@@ -1221,7 +1221,7 @@ static void Hal_ReadPowerValueFromPROM_8723B(
> 
> 	memset(pwrInfo24G, 0, sizeof(struct TxPowerInfo24G));
> 
>-	if (0xFF == PROMContent[eeAddr+1])
>+	if (PROMContent[eeAddr+1] == 0xFF)
> 		AutoLoadFail = true;
> 
> 	if (AutoLoadFail) {
>@@ -2035,7 +2035,7 @@ static void hw_var_set_bcn_func(struct adapter *padapter, u8 variable, u8 *val)
> 		val8 &= ~(EN_BCN_FUNCTION | EN_TXBCN_RPT);
> 
> 		/*  Always enable port0 beacon function for PSTDMA */
>-		if (REG_BCN_CTRL == bcn_ctrl_reg)
>+		if (bcn_ctrl_reg == REG_BCN_CTRL)
> 			val8 |= EN_BCN_FUNCTION;
> 
> 		rtw_write8(padapter, bcn_ctrl_reg, val8);
>diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
>index a1f2cbf2cf55..9f6503ac2234 100644
>--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
>+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
>@@ -413,7 +413,7 @@ int rtl8723bs_xmit_thread(void *context)
> 		if (signal_pending(current)) {
> 			flush_signals(current);
> 		}
>-	} while (_SUCCESS == ret);
>+	} while (ret == _SUCCESS);
> 
> 	complete(&pxmitpriv->SdioXmitTerminate);
> 
>diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
>index 0f28c904a714..0f378830462f 100644
>--- a/drivers/staging/rtl8723bs/include/ieee80211.h
>+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
>@@ -395,8 +395,8 @@ enum {
> };
> 
> #define IS_HT_RATE(_rate)				(_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
>-#define IS_CCK_RATE(_rate)				(MGN_1M == _rate || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
>-#define IS_OFDM_RATE(_rate)				(MGN_6M <= _rate && _rate <= MGN_54M  && _rate != MGN_11M)
>+#define IS_CCK_RATE(_rate)				(_rate == MGN_1M || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
>+#define IS_OFDM_RATE(_rate)				(_rate >= MGN_6M && _rate <= MGN_54M  && _rate != MGN_11M)
> 
> 
> /* NOTE: This data is for statistical purposes; not all hardware provides this

Sorry, I sent it from the wrong email.
Please use luka.gejak@linux.dev instead of lukagejak5@gmail.com.
LGTM,
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>

  parent reply	other threads:[~2026-04-05 12:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05 11:41 [RFT PATCH v3 0/5] staging: rtl8723bs: Code cleanup in drivers/staging/rtl8723bs Prithvi Tambewagh
2026-04-05 11:41 ` [RFT PATCH v3 1/5] staging: rtl8723bs: move constant to right side of test in comparison Prithvi Tambewagh
2026-04-05 12:49   ` Luka Gejak
2026-04-05 12:51   ` Luka Gejak [this message]
2026-04-06 20:45     ` Ethan Tidmore
2026-04-07  4:34   ` Luka Gejak
2026-04-07  4:37   ` Luka Gejak
2026-04-05 11:41 ` [RFT PATCH v3 2/5] staging: rtl8723bs: remove empty if statement block Prithvi Tambewagh
2026-04-05 12:53   ` Luka Gejak
2026-04-05 11:41 ` [RFT PATCH v3 3/5] staging: rtl8723bs: simplify boolean return in IsFrameTypeCtrl() Prithvi Tambewagh
2026-04-05 12:54   ` Luka Gejak
2026-04-05 11:41 ` [RFT PATCH v3 4/5] staging: rtl8723bs: use read_poll_timeout_atomic in _is_fw_read_cmd_down Prithvi Tambewagh
2026-04-05 12:55   ` Luka Gejak
2026-04-05 11:41 ` [RFT PATCH v3 5/5] staging: rtl8723bs: remove duplicate rate checks in PHY_GetTxPowerIndexBase() Prithvi Tambewagh
2026-04-05 12:57   ` Luka Gejak
2026-04-06 20:47     ` Ethan Tidmore
2026-04-05 13:01 ` [RFT PATCH v3 0/5] staging: rtl8723bs: Code cleanup in drivers/staging/rtl8723bs Luka Gejak

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=F31C7F72-D267-450E-81FA-DAA3F14FDEE9@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=abrahamadekunle50@gmail.com \
    --cc=activprithvi@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=b9788213@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=david.hunter.linux@gmail.com \
    --cc=dharanitharan725@gmail.com \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ignacio.pena87@gmail.com \
    --cc=karanja99erick@gmail.com \
    --cc=khalid@kernel.org \
    --cc=knavaneeth786@gmail.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=s9430939@naver.com \
    --cc=samasth.norway.ananda@oracle.com \
    --cc=skhan@linuxfoundation.org \
    --cc=straube.linux@gmail.com \
    --cc=suunj1331@gmail.com \
    --cc=weibu@redadmin.org \
    --cc=ysinghcin@gmail.com \
    /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