Skip to contentSkip to conversation

staging: rtl8188eu: place constant on the right side of test

PATCH Superseded Santha Meena Ramamoorthy 2 participants 2 messages Mar 5, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8188eu: place constant on the right side of test

Place constants on the right side of the test during comparisons to conform to the Linux kernel coding style.

---
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c      | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c       | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 8 ++++----
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c    | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +1 -1
index 1ab2e55..8d242ad 100644
@@ -36,7 +36,7 @@ static u8 _is_fw_read_cmd_down(struct adapter *adapt, u8 msgbox_num)
 
 	do {
 		valid = usb_read8(adapt, REG_HMETFR) & BIT(msgbox_num);
-		if (0 == valid)
+		if (valid == 0)
 			read_down = true;
 	} while ((!read_down) && (retry_cnts--));
 
drivers/staging/rtl8188eu/hal/rtl8188e_dm.c +1 -1
index d04b7fb..ff227c8 100644
@@ -182,7 +182,7 @@ void rtw_hal_dm_init(struct adapter *Adapter)
 /*  Compare RSSI for deciding antenna */
 void rtw_hal_antdiv_rssi_compared(struct adapter *Adapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
 {
-	if (0 != Adapter->HalData->AntDivCfg) {
+	if (Adapter->HalData->AntDivCfg != 0) {
 		/* select optimum_antenna for before linked =>For antenna diversity */
 		if (dst->Rssi >=  src->Rssi) {/* keep org parameter */
 			src->Rssi = dst->Rssi;
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +4 -4
index 3673f57..54ede4b 100644
@@ -221,13 +221,13 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
 	} else {
 		for (i = 0; i < (txpktbuf_bndy - 1); i++) {
 			status = _LLTWrite(padapter, i, i + 1);
-			if (_SUCCESS != status)
+			if (status != _SUCCESS)
 				return status;
 		}
 
 		/*  end of list */
 		status = _LLTWrite(padapter, (txpktbuf_bndy - 1), 0xFF);
-		if (_SUCCESS != status)
+		if (status != _SUCCESS)
 			return status;
 
 		/*  Make the other pages as ring buffer */
@@ -235,13 +235,13 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
 		/*  Otherwise used as local loopback buffer. */
 		for (i = txpktbuf_bndy; i < Last_Entry_Of_TxPktBuf; i++) {
 			status = _LLTWrite(padapter, i, (i + 1));
-			if (_SUCCESS != status)
+			if (status != _SUCCESS)
 				return status;
 		}
 
 		/*  Let last entry point to the start entry of ring buffer */
 		status = _LLTWrite(padapter, Last_Entry_Of_TxPktBuf, txpktbuf_bndy);
-		if (_SUCCESS != status) {
+		if (status != _SUCCESS) {
 			return status;
 		}
 	}
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +1 -1
index a9912b6..4f0f512 100644
@@ -552,7 +552,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
 		pbuf = round_up(pbuf_tail, 8);
 
 		pfirstframe->agg_num++;
-		if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
+		if (pfirstframe->agg_num ==  MAX_TX_AGG_PACKET_NUMBER)
 			break;
 
 		if (pbuf < bulkptr) {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Santha Meena Ramamoorthy

Place constants on the right side of the test during comparisons to conform to the Linux kernel coding style.

Hi Santha,

I wonder how did you find this issue? If any tool was used, then as you have done in other patches it would be good to add 'Issue found using X'.

Quoted 92 lines
---
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c      | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c       | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 8 ++++----
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c    | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +1 -1
index 1ab2e55..8d242ad 100644
@@ -36,7 +36,7 @@ static u8 _is_fw_read_cmd_down(struct adapter *adapt, u8 msgbox_num)
 
        do {
                valid = usb_read8(adapt, REG_HMETFR) & BIT(msgbox_num);
-               if (0 == valid)
+               if (valid == 0)
                        read_down = true;
        } while ((!read_down) && (retry_cnts--));
 
drivers/staging/rtl8188eu/hal/rtl8188e_dm.c +1 -1
index d04b7fb..ff227c8 100644
@@ -182,7 +182,7 @@ void rtw_hal_dm_init(struct adapter *Adapter)
 /*  Compare RSSI for deciding antenna */
 void rtw_hal_antdiv_rssi_compared(struct adapter *Adapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
 {
-       if (0 != Adapter->HalData->AntDivCfg) {
+       if (Adapter->HalData->AntDivCfg != 0) {
                /* select optimum_antenna for before linked =>For antenna diversity */
                if (dst->Rssi >=  src->Rssi) {/* keep org parameter */
                        src->Rssi = dst->Rssi;
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +4 -4
index 3673f57..54ede4b 100644
@@ -221,13 +221,13 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
        } else {
                for (i = 0; i < (txpktbuf_bndy - 1); i++) {
                        status = _LLTWrite(padapter, i, i + 1);
-                       if (_SUCCESS != status)
+                       if (status != _SUCCESS)
                                return status;
                }
 
                /*  end of list */
                status = _LLTWrite(padapter, (txpktbuf_bndy - 1), 0xFF);
-               if (_SUCCESS != status)
+               if (status != _SUCCESS)
                        return status;
 
                /*  Make the other pages as ring buffer */
@@ -235,13 +235,13 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
                /*  Otherwise used as local loopback buffer. */
                for (i = txpktbuf_bndy; i < Last_Entry_Of_TxPktBuf; i++) {
                        status = _LLTWrite(padapter, i, (i + 1));
-                       if (_SUCCESS != status)
+                       if (status != _SUCCESS)
                                return status;
                }
 
                /*  Let last entry point to the start entry of ring buffer */
                status = _LLTWrite(padapter, Last_Entry_Of_TxPktBuf, txpktbuf_bndy);
-               if (_SUCCESS != status) {
+               if (status != _SUCCESS) {
                        return status;
                }
        }
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +1 -2
index a9912b6..4f0f512 100644
@@ -552,7 +552,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
                pbuf = round_up(pbuf_tail, 8);
 
                pfirstframe->agg_num++;
-               if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
+               if (pfirstframe->agg_num ==  MAX_TX_AGG_PACKET_NUMBER)
                        break;
 
                if (pbuf < bulkptr) {
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1520271071-53018-1-git-send-email-santhameena13%40gmail.com.
For more options, visit https://groups.google.com/d/optout.