public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches
@ 2023-03-29 17:01 Abhirup Deb
  2023-03-29 17:01 ` [PATCH 1/5] staging: r8188eu: add blank line after declaration Abhirup Deb
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

This series of patches fixes the coding-style issues
reported by checkpatch.pl for the staging/r8188eu driver.

Abhirup Deb (5):
  staging: r8188eu: add blank line after declaration
  staging: r8188eu: refactor block-comments
  staging: r8188eu: remove redundant else after return
  staging: r8188eu: Replace "<<" with BIT macro
  staging: r8188eu: place constants on right side of comparison

 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 61 +++++++-------
 drivers/staging/r8188eu/hal/rtl8188e_cmd.c    |  2 +-
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  2 +-
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 10 +--
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c  |  2 +-
 drivers/staging/r8188eu/hal/usb_halinit.c     | 23 ++++--
 drivers/staging/r8188eu/include/ieee80211.h   | 82 +++++++++----------
 drivers/staging/r8188eu/include/rtw_mlme.h    |  4 +-
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  6 +-
 9 files changed, 98 insertions(+), 94 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] staging: r8188eu: add blank line after declaration
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
@ 2023-03-29 17:01 ` Abhirup Deb
  2023-03-29 17:01 ` [PATCH 2/5] staging: r8188eu: refactor block-comments Abhirup Deb
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

Add a blank line after variable declaration to improve
code-readability and resolve checkpatch warnings.

checkpatch warning produced:

WARNING: Missing a blank line after declarations

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/hal/usb_halinit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index d28b4dc2a767..2ba1c1b25a76 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -93,6 +93,7 @@ u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
 
 	/*  HW Power on sequence */
 	struct hal_data_8188e *haldata = &adapt->haldata;
+
 	if (haldata->bMacPwrCtrlOn)
 		return _SUCCESS;
 
@@ -295,6 +296,7 @@ static void _InitTransferPageSize(struct adapter *Adapter)
 	/*  Tx page size is always 128. */
 
 	u8 value8;
+
 	value8 = _PSRX(PBP_128) | _PSTX(PBP_128);
 	rtw_write8(Adapter, REG_PBP, value8);
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] staging: r8188eu: refactor block-comments
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
  2023-03-29 17:01 ` [PATCH 1/5] staging: r8188eu: add blank line after declaration Abhirup Deb
@ 2023-03-29 17:01 ` Abhirup Deb
  2023-03-29 17:01 ` [PATCH 3/5] staging: r8188eu: remove redundant else after return Abhirup Deb
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

Fix block comments by moving "/*" & "*/" symbols
on separate lines in adherence to the linux kernel
coding-style.

checkpatch warning produced:

WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/hal/usb_halinit.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 2ba1c1b25a76..9c2774eb5f78 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -381,8 +381,8 @@ static void _InitRetryFunction(struct adapter *Adapter)
 	/*  Set ACK timeout */
 	rtw_write8(Adapter, REG_ACKTO, 0x40);
 }
-
-/*-----------------------------------------------------------------------------
+/*
+ *-----------------------------------------------------------------------------
  * Function:	usb_AggSettingTxUpdate()
  *
  * Overview:	Separate TX/RX parameters update independent for TP detection and
@@ -396,7 +396,8 @@ static void _InitRetryFunction(struct adapter *Adapter)
  *	When		Who		Remark
  *	12/10/2010	MHC		Separate to smaller function.
  *
- *---------------------------------------------------------------------------*/
+ *---------------------------------------------------------------------------
+ */
 static void usb_AggSettingTxUpdate(struct adapter *Adapter)
 {
 	u32 value32;
@@ -414,8 +415,8 @@ static void usb_AggSettingTxUpdate(struct adapter *Adapter)
 
 	rtw_write32(Adapter, REG_TDECTRL, value32);
 }
-
-/*-----------------------------------------------------------------------------
+/*
+ *-----------------------------------------------------------------------------
  * Function:	usb_AggSettingRxUpdate()
  *
  * Overview:	Separate TX/RX parameters update independent for TP detection and
@@ -429,7 +430,8 @@ static void usb_AggSettingTxUpdate(struct adapter *Adapter)
  *	When		Who		Remark
  *	12/10/2010	MHC		Separate to smaller function.
  *
- *---------------------------------------------------------------------------*/
+ *---------------------------------------------------------------------------
+ */
 static void
 usb_AggSettingRxUpdate(
 		struct adapter *Adapter
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] staging: r8188eu: remove redundant else after return
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
  2023-03-29 17:01 ` [PATCH 1/5] staging: r8188eu: add blank line after declaration Abhirup Deb
  2023-03-29 17:01 ` [PATCH 2/5] staging: r8188eu: refactor block-comments Abhirup Deb
@ 2023-03-29 17:01 ` Abhirup Deb
  2023-03-29 17:01 ` [PATCH 4/5] staging: r8188eu: Replace "<<" with BIT macro Abhirup Deb
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

remove 'else'-clause that is not required after a
'return' statement.

checkpatch warning produced:

WARNING: else is not generally useful after a break or return

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c | 61 ++++++++++-----------
 drivers/staging/r8188eu/hal/usb_halinit.c   |  7 ++-
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 1b9cf7596a76..6302901a3be1 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -7721,49 +7721,48 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
 	if (send_beacon(padapter) == _FAIL) {
 		return H2C_PARAMETERS_ERROR;
-	} else {
-		/* tx bc/mc frames after update TIM */
-		struct sta_info *psta_bmc;
-		struct list_head *xmitframe_plist, *xmitframe_phead;
-		struct xmit_frame *pxmitframe = NULL;
-		struct sta_priv  *pstapriv = &padapter->stapriv;
+	}
+	/* tx bc/mc frames after update TIM */
+	struct sta_info *psta_bmc;
+	struct list_head *xmitframe_plist, *xmitframe_phead;
+	struct xmit_frame *pxmitframe = NULL;
+	struct sta_priv  *pstapriv = &padapter->stapriv;
 
-		/* for BC/MC Frames */
-		psta_bmc = rtw_get_bcmc_stainfo(padapter);
-		if (!psta_bmc)
-			return H2C_SUCCESS;
+	/* for BC/MC Frames */
+	psta_bmc = rtw_get_bcmc_stainfo(padapter);
+	if (!psta_bmc)
+		return H2C_SUCCESS;
 
-		if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
-			msleep(10);/*  10ms, ATIM(HIQ) Windows */
-			spin_lock_bh(&psta_bmc->sleep_q.lock);
+	if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
+		msleep(10);/*  10ms, ATIM(HIQ) Windows */
+		spin_lock_bh(&psta_bmc->sleep_q.lock);
 
-			xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
-			xmitframe_plist = xmitframe_phead->next;
+		xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
+		xmitframe_plist = xmitframe_phead->next;
 
-			while (xmitframe_phead != xmitframe_plist) {
-				pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
+		while (xmitframe_phead != xmitframe_plist) {
+			pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
-				xmitframe_plist = xmitframe_plist->next;
+			xmitframe_plist = xmitframe_plist->next;
 
-				list_del_init(&pxmitframe->list);
+			list_del_init(&pxmitframe->list);
 
-				psta_bmc->sleepq_len--;
-				if (psta_bmc->sleepq_len > 0)
-					pxmitframe->attrib.mdata = 1;
-				else
-					pxmitframe->attrib.mdata = 0;
+			psta_bmc->sleepq_len--;
+			if (psta_bmc->sleepq_len > 0)
+				pxmitframe->attrib.mdata = 1;
+			else
+				pxmitframe->attrib.mdata = 0;
 
-				pxmitframe->attrib.triggered = 1;
+			pxmitframe->attrib.triggered = 1;
 
-				pxmitframe->attrib.qsel = 0x11;/* HIQ */
+			pxmitframe->attrib.qsel = 0x11;/* HIQ */
 
-				spin_unlock_bh(&psta_bmc->sleep_q.lock);
-				if (rtl8188eu_hal_xmit(padapter, pxmitframe))
-					rtw_xmit_complete(padapter, pxmitframe);
-				spin_lock_bh(&psta_bmc->sleep_q.lock);
-			}
 			spin_unlock_bh(&psta_bmc->sleep_q.lock);
+			if (rtl8188eu_hal_xmit(padapter, pxmitframe))
+				rtw_xmit_complete(padapter, pxmitframe);
+			spin_lock_bh(&psta_bmc->sleep_q.lock);
 		}
+		spin_unlock_bh(&psta_bmc->sleep_q.lock);
 	}
 	return H2C_SUCCESS;
 }
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 9c2774eb5f78..8a8d74f0f2a6 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -596,10 +596,11 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
 		Adapter->bFWReady = false;
 		haldata->fw_ractrl = false;
 		return status;
-	} else {
-		Adapter->bFWReady = true;
-		haldata->fw_ractrl = false;
 	}
+
+	Adapter->bFWReady = true;
+	haldata->fw_ractrl = false;
+
 	/* Initialize firmware vars */
 	Adapter->pwrctrlpriv.bFwCurrentInPSMode = false;
 	haldata->LastHMEBoxNum = 0;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] staging: r8188eu: Replace "<<" with BIT macro
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
                   ` (2 preceding siblings ...)
  2023-03-29 17:01 ` [PATCH 3/5] staging: r8188eu: remove redundant else after return Abhirup Deb
@ 2023-03-29 17:01 ` Abhirup Deb
  2023-03-29 17:01 ` [PATCH 5/5] staging: r8188eu: place constants on right side of comparison Abhirup Deb
  2023-03-29 18:48 ` [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Philipp Hortmann
  5 siblings, 0 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

Replace the "<<" operator with BIT macro, in accordance to the
checkpatch.pl script and Linux kernel coding-style guidelines.

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/include/ieee80211.h | 82 ++++++++++-----------
 1 file changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/r8188eu/include/ieee80211.h b/drivers/staging/r8188eu/include/ieee80211.h
index e7a4f8af497a..4b58bd782944 100644
--- a/drivers/staging/r8188eu/include/ieee80211.h
+++ b/drivers/staging/r8188eu/include/ieee80211.h
@@ -300,15 +300,15 @@ struct ieee80211_snap_hdr {
 
 #define WLAN_AUTH_CHALLENGE_LEN 128
 
-#define WLAN_CAPABILITY_BSS (1<<0)
-#define WLAN_CAPABILITY_IBSS (1<<1)
-#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
-#define WLAN_CAPABILITY_PRIVACY (1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
-#define WLAN_CAPABILITY_PBCC (1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
-#define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
+#define WLAN_CAPABILITY_BSS BIT(0)
+#define WLAN_CAPABILITY_IBSS BIT(1)
+#define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
+#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
+#define WLAN_CAPABILITY_PRIVACY BIT(4)
+#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
+#define WLAN_CAPABILITY_PBCC BIT(6)
+#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
+#define WLAN_CAPABILITY_SHORT_SLOT BIT(10)
 
 /* Status codes */
 #define WLAN_STATUS_SUCCESS 0
@@ -382,17 +382,17 @@ struct ieee80211_snap_hdr {
 #define IEEE80211_DATA_HDR3_LEN 24
 #define IEEE80211_DATA_HDR4_LEN 30
 
-#define IEEE80211_STATMASK_SIGNAL (1<<0)
-#define IEEE80211_STATMASK_RSSI (1<<1)
-#define IEEE80211_STATMASK_NOISE (1<<2)
-#define IEEE80211_STATMASK_RATE (1<<3)
+#define IEEE80211_STATMASK_SIGNAL BIT(0)
+#define IEEE80211_STATMASK_RSSI BIT(1)
+#define IEEE80211_STATMASK_NOISE BIT(2)
+#define IEEE80211_STATMASK_RATE BIT(3)
 #define IEEE80211_STATMASK_WEMASK 0x7
 
 #define IEEE80211_CCK_MODULATION    (1<<0)
 #define IEEE80211_OFDM_MODULATION   (1<<1)
 
-#define IEEE80211_24GHZ_BAND     (1<<0)
-#define IEEE80211_52GHZ_BAND     (1<<1)
+#define IEEE80211_24GHZ_BAND     BIT(0)
+#define IEEE80211_52GHZ_BAND     BIT(1)
 
 #define IEEE80211_CCK_RATE_LEN			4
 #define IEEE80211_NUM_OFDM_RATESLEN	8
@@ -412,18 +412,18 @@ struct ieee80211_snap_hdr {
 #define IEEE80211_OFDM_RATE_54MB		0x6C
 #define IEEE80211_BASIC_RATE_MASK		0x80
 
-#define IEEE80211_CCK_RATE_1MB_MASK		(1<<0)
-#define IEEE80211_CCK_RATE_2MB_MASK		(1<<1)
-#define IEEE80211_CCK_RATE_5MB_MASK		(1<<2)
-#define IEEE80211_CCK_RATE_11MB_MASK		(1<<3)
-#define IEEE80211_OFDM_RATE_6MB_MASK		(1<<4)
-#define IEEE80211_OFDM_RATE_9MB_MASK		(1<<5)
-#define IEEE80211_OFDM_RATE_12MB_MASK		(1<<6)
-#define IEEE80211_OFDM_RATE_18MB_MASK		(1<<7)
-#define IEEE80211_OFDM_RATE_24MB_MASK		(1<<8)
-#define IEEE80211_OFDM_RATE_36MB_MASK		(1<<9)
-#define IEEE80211_OFDM_RATE_48MB_MASK		(1<<10)
-#define IEEE80211_OFDM_RATE_54MB_MASK		(1<<11)
+#define IEEE80211_CCK_RATE_1MB_MASK		BIT(0)
+#define IEEE80211_CCK_RATE_2MB_MASK		BIT(1)
+#define IEEE80211_CCK_RATE_5MB_MASK		BIT(2)
+#define IEEE80211_CCK_RATE_11MB_MASK		BIT(3)
+#define IEEE80211_OFDM_RATE_6MB_MASK		BIT(4)
+#define IEEE80211_OFDM_RATE_9MB_MASK		BIT(5)
+#define IEEE80211_OFDM_RATE_12MB_MASK		BIT(6)
+#define IEEE80211_OFDM_RATE_18MB_MASK		BIT(7)
+#define IEEE80211_OFDM_RATE_24MB_MASK		BIT(8)
+#define IEEE80211_OFDM_RATE_36MB_MASK		BIT(9)
+#define IEEE80211_OFDM_RATE_48MB_MASK		BIT(10)
+#define IEEE80211_OFDM_RATE_54MB_MASK		BIT(11)
 
 #define IEEE80211_CCK_RATES_MASK		0x0000000F
 #define IEEE80211_CCK_BASIC_RATES_MASK	(IEEE80211_CCK_RATE_1MB_MASK | \
@@ -458,15 +458,15 @@ struct ieee80211_snap_hdr {
  * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
 #define IEEE80211_FRAG_CACHE_LEN 4
 
-#define SEC_KEY_1	(1<<0)
-#define SEC_KEY_2	(1<<1)
-#define SEC_KEY_3	(1<<2)
-#define SEC_KEY_4	(1<<3)
-#define SEC_ACTIVE_KEY  (1<<4)
-#define SEC_AUTH_MODE   (1<<5)
-#define SEC_UNICAST_GROUP (1<<6)
-#define SEC_LEVEL	(1<<7)
-#define SEC_ENABLED     (1<<8)
+#define SEC_KEY_1	BIT(0)
+#define SEC_KEY_2	BIT(1)
+#define SEC_KEY_3	BIT(2)
+#define SEC_KEY_4	BIT(3)
+#define SEC_ACTIVE_KEY  BIT(4)
+#define SEC_AUTH_MODE   BIT(5)
+#define SEC_UNICAST_GROUP BIT(6)
+#define SEC_LEVEL	BIT(7)
+#define SEC_ENABLED     BIT(8)
 
 #define SEC_LEVEL_0      0 /* None */
 #define SEC_LEVEL_1      1 /* WEP 40 and 104 bit */
@@ -550,9 +550,9 @@ Total: 28-2340 bytes
 #define MAX_P2P_IE_LEN (256)
 #define MAX_WFD_IE_LEN (128)
 
-#define NETWORK_EMPTY_ESSID (1<<0)
-#define NETWORK_HAS_OFDM    (1<<1)
-#define NETWORK_HAS_CCK     (1<<2)
+#define NETWORK_EMPTY_ESSID BIT(0)
+#define NETWORK_HAS_OFDM    BIT(1)
+#define NETWORK_HAS_CCK     BIT(2)
 
 #define IEEE80211_DTIM_MBCAST 4
 #define IEEE80211_DTIM_UCAST 2
@@ -584,8 +584,8 @@ static inline int is_broadcast_mac_addr(const u8 *addr)
 	       (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff);
 }
 
-#define CFG_IEEE80211_RESERVE_FCS (1<<0)
-#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
+#define CFG_IEEE80211_RESERVE_FCS BIT(0)
+#define CFG_IEEE80211_COMPUTE_FCS BIT(1)
 
 #define MAXTID	16
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] staging: r8188eu: place constants on right side of comparison
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
                   ` (3 preceding siblings ...)
  2023-03-29 17:01 ` [PATCH 4/5] staging: r8188eu: Replace "<<" with BIT macro Abhirup Deb
@ 2023-03-29 17:01 ` Abhirup Deb
  2023-03-29 18:48 ` [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Philipp Hortmann
  5 siblings, 0 replies; 7+ messages in thread
From: Abhirup Deb @ 2023-03-29 17:01 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: abhirupdeb

Fix comparison statements to place constants on the right hand
side of the equation to improve code-readability and
adhering to the linux kernel coding-style.

checkpatch warning produced:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/hal/rtl8188e_cmd.c      |  2 +-
 drivers/staging/r8188eu/hal/rtl8188e_dm.c       |  2 +-
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 10 +++++-----
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c    |  2 +-
 drivers/staging/r8188eu/include/rtw_mlme.h      |  4 ++--
 drivers/staging/r8188eu/os_dep/ioctl_linux.c    |  6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
index 8310d7f53982..dfbd1ad554e4 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
@@ -28,7 +28,7 @@ static u8 _is_fw_read_cmd_down(struct adapter *adapt, u8 msgbox_num)
 			continue;
 
 		valid = reg & BIT(msgbox_num);
-		if (0 == valid)
+		if (valid == 0)
 			read_down = true;
 	} while ((!read_down) && (retry_cnts--));
 
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index 0399872c4546..9dea34fdde15 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -108,7 +108,7 @@ void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, stru
 {
 	struct hal_data_8188e *hal_data = &Adapter->haldata;
 
-	if (0 != hal_data->AntDivCfg) {
+	if (hal_data->AntDivCfg != 0) {
 		/* select optimum_antenna for before linked =>For antenna diversity */
 		if (dst->Rssi >=  src->Rssi) {/* keep org parameter */
 			src->Rssi = dst->Rssi;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 73855bca76fe..4af9acb83c5b 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -519,7 +519,7 @@ void rtl8188e_ReadEFuse(struct adapter *Adapter, u16 _size_byte, u8 *pbuf)
 		ret = iol_read_efuse(Adapter, _size_byte, pbuf);
 		iol_mode_enable(Adapter, 0);
 
-		if (_SUCCESS == ret)
+		if (ret == _SUCCESS)
 			return;
 	}
 
@@ -648,13 +648,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 */
@@ -662,13 +662,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;
 		}
 	}
diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
index 6d1f56d1f9d7..f5e22b6bda57 100644
--- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
@@ -513,7 +513,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit
 		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) {
diff --git a/drivers/staging/r8188eu/include/rtw_mlme.h b/drivers/staging/r8188eu/include/rtw_mlme.h
index 3ff653ff1d81..2efefc26f45a 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme.h
@@ -454,7 +454,7 @@ static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state)
 {
 	pmlmepriv->fw_state |= state;
 	/* FOR HW integration */
-	if (_FW_UNDER_SURVEY == state)
+	if (state == _FW_UNDER_SURVEY)
 		pmlmepriv->bScanInProcess = true;
 }
 
@@ -462,7 +462,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
 {
 	pmlmepriv->fw_state &= ~state;
 	/* FOR HW integration */
-	if (_FW_UNDER_SURVEY == state)
+	if (state == _FW_UNDER_SURVEY)
 		pmlmepriv->bScanInProcess = false;
 }
 
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 8e9b7b0664bc..21e8ffa04ab6 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -3071,11 +3071,11 @@ static int rtw_rereg_nd_name(struct net_device *dev,
 	if (copy_from_user(new_ifname, wrqu->data.pointer, IFNAMSIZ))
 		return -EFAULT;
 
-	if (0 == strcmp(rereg_priv->old_ifname, new_ifname))
+	if (strcmp(rereg_priv->old_ifname, new_ifname) == 0)
 		return ret;
 
 	ret = rtw_change_ifname(padapter, new_ifname);
-	if (0 != ret)
+	if (ret != 0)
 		goto exit;
 
 	if (!memcmp(rereg_priv->old_ifname, "disable%d", 9)) {
@@ -3558,7 +3558,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
 		int probereq_wpsie_len = len;
 		u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
 
-		if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
+		if ((probereq_wpsie[0] == _VENDOR_SPECIFIC_IE_) &&
 		    (!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
 			cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches
  2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
                   ` (4 preceding siblings ...)
  2023-03-29 17:01 ` [PATCH 5/5] staging: r8188eu: place constants on right side of comparison Abhirup Deb
@ 2023-03-29 18:48 ` Philipp Hortmann
  5 siblings, 0 replies; 7+ messages in thread
From: Philipp Hortmann @ 2023-03-29 18:48 UTC (permalink / raw)
  To: Abhirup Deb, Martyn Welch, Manohar Vanga, Greg Kroah-Hartman,
	linux-kernel, linux-staging

On 3/29/23 19:01, Abhirup Deb wrote:
> This series of patches fixes the coding-style issues
> reported by checkpatch.pl for the staging/r8188eu driver.
> 
> Abhirup Deb (5):
>    staging: r8188eu: add blank line after declaration
>    staging: r8188eu: refactor block-comments
>    staging: r8188eu: remove redundant else after return
>    staging: r8188eu: Replace "<<" with BIT macro
>    staging: r8188eu: place constants on right side of comparison
> 
>   drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 61 +++++++-------
>   drivers/staging/r8188eu/hal/rtl8188e_cmd.c    |  2 +-
>   drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  2 +-
>   .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 10 +--
>   drivers/staging/r8188eu/hal/rtl8188eu_xmit.c  |  2 +-
>   drivers/staging/r8188eu/hal/usb_halinit.c     | 23 ++++--
>   drivers/staging/r8188eu/include/ieee80211.h   | 82 +++++++++----------
>   drivers/staging/r8188eu/include/rtw_mlme.h    |  4 +-
>   drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  6 +-
>   9 files changed, 98 insertions(+), 94 deletions(-)
> 


Hi,

sorry this driver was deleted: Please read:
https://lore.kernel.org/linux-staging/92a9442a-cece-4179-fbdc-3c9188da073e@redhat.com/

Please also check on which tree you are working on. This seems to be the 
wrong one.

If you need support I will help you.

Thanks for your support.

Bye Philipp

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-29 18:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
2023-03-29 17:01 ` [PATCH 1/5] staging: r8188eu: add blank line after declaration Abhirup Deb
2023-03-29 17:01 ` [PATCH 2/5] staging: r8188eu: refactor block-comments Abhirup Deb
2023-03-29 17:01 ` [PATCH 3/5] staging: r8188eu: remove redundant else after return Abhirup Deb
2023-03-29 17:01 ` [PATCH 4/5] staging: r8188eu: Replace "<<" with BIT macro Abhirup Deb
2023-03-29 17:01 ` [PATCH 5/5] staging: r8188eu: place constants on right side of comparison Abhirup Deb
2023-03-29 18:48 ` [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox