linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files
@ 2021-04-14  6:54 Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 1/5] staging: rtl8192e: add spaces around binary operators Mitali Borkar
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:54 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Changes from v1:- Dropped 6/6 from and made this as a patchset of 5 as
alignment of code is done in following patches.
[PATCH 1/5]:- No changes.
[PATCH 2/5]:- No changes.
[PATCH 3/5]:- No changes.
[PATCH 4/5]:- Rectified spelling mistake and replaced memcmp with
ether_oui_equal.
[PATCH 5/5]:- No changes.

Mitali Borkar (5):
  staging: rtl8192e: add spaces around binary operators
  staging: rtl8192e: remove unnecessary blank line before brace
  staging: rtl8192e: remove unnecessary blank line after close brace
  staging: rtl8192e: rectified spelling mistake and replace memcmp with
    ether_oui_equal
  staging: rtl8192e: removed multiple blank lines

 drivers/staging/rtl8192e/rtl819x_HTProc.c     | 67 ++++++++---------
 drivers/staging/rtl8192e/rtl819x_TSProc.c     | 10 +++--
 include/linux/etherdevice.h                   |  5 +
 3 files changed, 37 insertions(+), 45 deletions(-)

-- 
2.30.2


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

* [PATCH v2 1/5] staging: rtl8192e: add spaces around binary operators
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
@ 2021-04-14  6:55 ` Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 2/5] staging: rtl8192e: remove unnecessary blank line before brace Mitali Borkar
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:55 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Added spaces around binary operators like '+', '*', '|', '-', '&',
to improve readability and to meet linux kernel coding style.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
 
Changes from v1:- No changes.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 8 ++++----
 drivers/staging/rtl8192e/rtl819x_TSProc.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 4a2968566b93..b74c6ac817d4 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -138,7 +138,7 @@ u16  TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate)
 		is40MHz = 1;
 		isShortGI = 1;
 	}
-	return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate&0xf];
+	return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate & 0xf];
 }
 
 bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
@@ -479,8 +479,8 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,
 		if (availableMcsRate[i] != 0) {
 			bitMap = availableMcsRate[i];
 			for (j = 0; j < 8; j++) {
-				if ((bitMap%2) != 0) {
-					if (HTMcsToDataRate(ieee, (8*i+j)) >
+				if ((bitMap % 2) != 0) {
+					if (HTMcsToDataRate(ieee, (8 * i + j)) >
 					    HTMcsToDataRate(ieee, mcsRate))
 						mcsRate = 8 * i + j;
 				}
@@ -577,7 +577,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 
 	pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
 	if (ieee->rtllib_ap_sec_type &&
-	   (ieee->rtllib_ap_sec_type(ieee)&(SEC_ALG_WEP|SEC_ALG_TKIP))) {
+	   (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
 		if ((pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) ||
 				(pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN))
 			pHTInfo->bCurrentAMPDUEnable = false;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 6c51323104e5..b14ed3534ffa 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -104,7 +104,7 @@ static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
 {
 	eth_zero_addr(pTsCommonInfo->Addr);
 	memset(&pTsCommonInfo->TSpec, 0, sizeof(union tspec_body));
-	memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas)*TCLAS_NUM);
+	memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
 	pTsCommonInfo->TClasProc = 0;
 	pTsCommonInfo->TClasNum = 0;
 }
@@ -188,9 +188,9 @@ void TSInitialize(struct rtllib_device *ieee)
 	for (count = 0; count < REORDER_ENTRY_NUM; count++) {
 		list_add_tail(&pRxReorderEntry->List,
 			      &ieee->RxReorder_Unused_List);
-		if (count == (REORDER_ENTRY_NUM-1))
+		if (count == (REORDER_ENTRY_NUM - 1))
 			break;
-		pRxReorderEntry = &ieee->RxReorderEntry[count+1];
+		pRxReorderEntry = &ieee->RxReorderEntry[count + 1];
 	}
 
 }
@@ -517,7 +517,7 @@ void TsStartAddBaProcess(struct rtllib_device *ieee, struct tx_ts_record *pTxTS)
 				  msecs_to_jiffies(TS_ADDBA_DELAY));
 		} else {
 			netdev_dbg(ieee->dev, "Immediately Start ADDBA\n");
-			mod_timer(&pTxTS->TsAddBaTimer, jiffies+10);
+			mod_timer(&pTxTS->TsAddBaTimer, jiffies + 10);
 		}
 	} else
 		netdev_dbg(ieee->dev, "BA timer is already added\n");
-- 
2.30.2


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

* [PATCH v2 2/5] staging: rtl8192e: remove unnecessary blank line before brace
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 1/5] staging: rtl8192e: add spaces around binary operators Mitali Borkar
@ 2021-04-14  6:55 ` Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace Mitali Borkar
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:55 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Removed an extra blank line before close brace as it was not necessary.
Reported by checkpatch.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
 
Changes from v1:- No changes.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 --
 drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index b74c6ac817d4..651441a71646 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -263,7 +263,6 @@ static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss)
 
 	if (pHTInfo->IOTAction & HT_IOT_ACT_AMSDU_ENABLE)
 		pHTInfo->IOTRaFunc |= HT_IOT_RAFUNC_TX_AMSDU;
-
 }
 
 void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo)
@@ -445,7 +444,6 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS)
 		break;
 	default:
 		break;
-
 	}
 
 	return true;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index b14ed3534ffa..34b00a76b6bd 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -192,7 +192,6 @@ void TSInitialize(struct rtllib_device *ieee)
 			break;
 		pRxReorderEntry = &ieee->RxReorderEntry[count + 1];
 	}
-
 }
 
 static void AdmitTS(struct rtllib_device *ieee,
@@ -253,7 +252,6 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
 			    pRet->TSpec.f.TSInfo.field.ucTSID == TID &&
 			    pRet->TSpec.f.TSInfo.field.ucDirection == dir)
 				break;
-
 		}
 		if (&pRet->List  != psearch_list)
 			break;
-- 
2.30.2


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

* [PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 1/5] staging: rtl8192e: add spaces around binary operators Mitali Borkar
  2021-04-14  6:55 ` [PATCH v2 2/5] staging: rtl8192e: remove unnecessary blank line before brace Mitali Borkar
@ 2021-04-14  6:55 ` Mitali Borkar
  2021-04-14  6:56 ` [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal Mitali Borkar
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:55 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Removed an extra blank line after close brace '{' as it was not
necessary.
Reported by checkpatch

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
 
Changes from v1:- No changes.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 651441a71646..b6805908bbbd 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -492,7 +492,6 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,
 static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS,
 			  u8 *pOperateMCS)
 {
-
 	u8 i;
 
 	for (i = 0; i <= 15; i++)
@@ -685,7 +684,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
 
 void HTInitializeBssDesc(struct bss_ht *pBssHT)
 {
-
 	pBssHT->bd_support_ht = false;
 	memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf));
 	pBssHT->bd_ht_cap_len = 0;
-- 
2.30.2


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

* [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
                   ` (2 preceding siblings ...)
  2021-04-14  6:55 ` [PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace Mitali Borkar
@ 2021-04-14  6:56 ` Mitali Borkar
  2021-04-14  7:55   ` Dan Carpenter
  2021-04-14  8:16   ` Greg KH
  2021-04-14  6:56 ` [PATCH v2 5/5] staging: rtl8192e: removed multiple blank lines Mitali Borkar
  2021-04-14  8:20 ` Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Greg KH
  5 siblings, 2 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:56 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Added a generic function of static inline bool in
include/linux/etherdevice.h to replace memcmp with
ether_oui_equal throughout the execution.
Corrected the misspelled words in this file.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
 
Changes from v1:- Rectified spelling mistake and replaced memcmp with
ether_oui_equal.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
 include/linux/etherdevice.h               |  5 +++
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index ec6b46166e84..ce58feb2af9a 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
 	 810, 720, 810, 900, 900, 990} }
 };
 
-static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
+static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
 
 static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
 
@@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
 	bool			retValue = false;
 	struct rtllib_network *net = &ieee->current_network;
 
-	if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
-	    (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
-	    (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
-	    (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
-	    (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
+	if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
+	    (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
+	    (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
+	    (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
+	    (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
 	    (net->ralink_cap_exist))
 		retValue = true;
-	else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
-		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
-		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
+	else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
+		 ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
+		 ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
 		 (net->broadcom_cap_exist))
 		retValue = true;
 	else if (net->bssht.bd_rt2rt_aggregation)
@@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee)
 			pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
 	} else if (net->broadcom_cap_exist) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
-	} else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
-		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
-		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
+	} else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
+		   ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
+		   ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
-	} else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
-		 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
-		 (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
-		 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
-		 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
-		  net->ralink_cap_exist) {
+	} else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
+		   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
+		   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
+		   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
+		   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
+		   net->ralink_cap_exist) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
 	} else if ((net->atheros_cap_exist) ||
-		(memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
-		(memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
+		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
+		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
-	} else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
-		  net->cisco_cap_exist) {
+	} else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
+		   net->cisco_cap_exist) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
-	} else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
-		  net->marvell_cap_exist) {
+	} else if ((ether_oui_equal(net->bssid, LINKSYS_MARVELL_4400N) == 0) ||
+		   net->marvell_cap_exist) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
 	} else if (net->airgo_cap_exist) {
 		pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 2e5debc0373c..6a1a63168319 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
 #endif
 }
 
+static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
+{
+return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
+}
+
 /**
  * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
  * @addr: Pointer to a six-byte array containing the Ethernet address
-- 
2.30.2


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

* [PATCH v2 5/5] staging: rtl8192e: removed multiple blank lines
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
                   ` (3 preceding siblings ...)
  2021-04-14  6:56 ` [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal Mitali Borkar
@ 2021-04-14  6:56 ` Mitali Borkar
  2021-04-14  8:20 ` Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Greg KH
  5 siblings, 0 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-14  6:56 UTC (permalink / raw)
  To: gregkh, davem, kuba
  Cc: linux-staging, linux-kernel, outreachy-kernel, mitali_s

Removed multiple blank lines to make code better and neater.
Reported by checkpatch.

Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
 
Changes from v1:- No changes.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index b11b0054d8cb..955442b95bdc 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -214,7 +214,6 @@ static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr)
 	return 0;
 }
 
-
 static bool HTIOTActIsDisableMCS15(struct rtllib_device *ieee)
 {
 	return false;
@@ -236,7 +235,6 @@ static u8 HTIOTActIsMgntUseCCK6M(struct rtllib_device *ieee,
 {
 	u8	retValue = 0;
 
-
 	if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM)
 		retValue = 1;
 
@@ -315,7 +313,6 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
 	pCapELE->PSMP = 0;
 	pCapELE->LSigTxopProtect = 0;
 
-
 	netdev_dbg(ieee->dev,
 		   "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n",
 		   pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
@@ -390,7 +387,6 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,
 
 		memset(pHTInfoEle->BasicMSC, 0, 16);
 
-
 		*len = 22 + 2;
 
 	} else {
@@ -541,7 +537,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 	else
 		pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf);
 
-
 #ifdef VERBOSE_DEBUG
 	print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE,
 			     pPeerHTCap, sizeof(struct ht_capab_ele));
@@ -562,7 +557,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 			       ((pPeerHTCap->DssCCk == 1) ? true :
 			       false) : false);
 
-
 	pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support;
 
 	nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935;
@@ -750,7 +744,6 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
 		if (bIOTAction)
 			pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_ALL_2SS;
 
-
 		bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid);
 		if (bIOTAction)
 			pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_EDCA_TURBO;
-- 
2.30.2


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

* Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-14  6:56 ` [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal Mitali Borkar
@ 2021-04-14  7:55   ` Dan Carpenter
  2021-04-15 14:03     ` Mitali Borkar
  2021-04-14  8:16   ` Greg KH
  1 sibling, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2021-04-14  7:55 UTC (permalink / raw)
  To: Mitali Borkar
  Cc: gregkh, davem, kuba, linux-staging, linux-kernel,
	outreachy-kernel, mitali_s

On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> Added a generic function of static inline bool in
> include/linux/etherdevice.h to replace memcmp with
> ether_oui_equal throughout the execution.
> Corrected the misspelled words in this file.
> 
> Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> ---
>  
> Changes from v1:- Rectified spelling mistake and replaced memcmp with
> ether_oui_equal.
> 
>  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
>  include/linux/etherdevice.h               |  5 +++
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is networking code and not staging code, but the netdev mailing
list isn't CC'd.

>  2 files changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index ec6b46166e84..ce58feb2af9a 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
>  	 810, 720, 810, 900, 900, 990} }
>  };
>  
> -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};

Please pull this spelling fix into its own patch.

[ snip ]

> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index 2e5debc0373c..6a1a63168319 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
>  #endif
>  }
>  
> +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> +{
> +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> +}

The indenting is messed up on this.

regards,
dan carpenter


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

* Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-14  6:56 ` [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal Mitali Borkar
  2021-04-14  7:55   ` Dan Carpenter
@ 2021-04-14  8:16   ` Greg KH
  2021-04-15 13:42     ` Mitali Borkar
  1 sibling, 1 reply; 12+ messages in thread
From: Greg KH @ 2021-04-14  8:16 UTC (permalink / raw)
  To: Mitali Borkar
  Cc: davem, kuba, linux-staging, linux-kernel, outreachy-kernel, mitali_s

On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> Added a generic function of static inline bool in
> include/linux/etherdevice.h to replace memcmp with
> ether_oui_equal throughout the execution.
> Corrected the misspelled words in this file.
> 
> Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> ---
>  
> Changes from v1:- Rectified spelling mistake and replaced memcmp with
> ether_oui_equal.
> 
>  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
>  include/linux/etherdevice.h               |  5 +++
>  2 files changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index ec6b46166e84..ce58feb2af9a 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
>  	 810, 720, 810, 900, 900, 990} }
>  };
>  
> -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
>  
>  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
>  
> @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
>  	bool			retValue = false;
>  	struct rtllib_network *net = &ieee->current_network;
>  
> -	if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> -	    (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> -	    (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> -	    (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> -	    (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> +	if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> +	    (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> +	    (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> +	    (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> +	    (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
>  	    (net->ralink_cap_exist))
>  		retValue = true;
> -	else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> +	else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> +		 ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> +		 ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
>  		 (net->broadcom_cap_exist))
>  		retValue = true;
>  	else if (net->bssht.bd_rt2rt_aggregation)
> @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee)
>  			pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
>  	} else if (net->broadcom_cap_exist) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> -	} else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> +	} else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> +		   ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> +		   ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> -	} else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> -		 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> -		 (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> -		 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> -		 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> -		  net->ralink_cap_exist) {
> +	} else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> +		   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> +		   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> +		   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> +		   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> +		   net->ralink_cap_exist) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
>  	} else if ((net->atheros_cap_exist) ||
> -		(memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> -		(memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> -	} else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> -		  net->cisco_cap_exist) {
> +	} else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
> +		   net->cisco_cap_exist) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
> -	} else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
> -		  net->marvell_cap_exist) {
> +	} else if ((ether_oui_equal(net->bssid, LINKSYS_MARVELL_4400N) == 0) ||
> +		   net->marvell_cap_exist) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
>  	} else if (net->airgo_cap_exist) {
>  		pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO;
> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index 2e5debc0373c..6a1a63168319 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
>  #endif
>  }
>  
> +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> +{
> +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> +}

Staging drivers are stand-alone, we can not add code outside of the
driver directory in these patches, sorry.

And as Dan said, this is wrong formatting, did you run checkpatch.pl on
your changes?

thanks,

greg k-h

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

* Re: Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files
  2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
                   ` (4 preceding siblings ...)
  2021-04-14  6:56 ` [PATCH v2 5/5] staging: rtl8192e: removed multiple blank lines Mitali Borkar
@ 2021-04-14  8:20 ` Greg KH
  5 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2021-04-14  8:20 UTC (permalink / raw)
  To: Mitali Borkar
  Cc: davem, kuba, linux-staging, linux-kernel, outreachy-kernel, mitali_s

On Wed, Apr 14, 2021 at 12:24:44PM +0530, Mitali Borkar wrote:
> Changes from v1:- Dropped 6/6 from and made this as a patchset of 5 as
> alignment of code is done in following patches.

Why is "Subject:" listed in your subject line?  Do not manually add it
after git format-patch has created it...

thanks,

greg k-h

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

* Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-14  8:16   ` Greg KH
@ 2021-04-15 13:42     ` Mitali Borkar
  2021-04-15 14:02       ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Mitali Borkar @ 2021-04-15 13:42 UTC (permalink / raw)
  To: Greg KH
  Cc: davem, kuba, linux-staging, linux-kernel, outreachy-kernel, mitali_s

On Wed, Apr 14, 2021 at 10:16:59AM +0200, Greg KH wrote:
> On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > Added a generic function of static inline bool in
> > include/linux/etherdevice.h to replace memcmp with
> > ether_oui_equal throughout the execution.
> > Corrected the misspelled words in this file.
> > 
> > Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> > ---
> >  
> > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > ether_oui_equal.
> > 
> >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
> >  include/linux/etherdevice.h               |  5 +++
> >  2 files changed, 29 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > index ec6b46166e84..ce58feb2af9a 100644
> > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> >  	 810, 720, 810, 900, 900, 990} }
> >  };
> >  
> > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> >  
> >  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
> >  
> > @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> >  	bool			retValue = false;
> >  	struct rtllib_network *net = &ieee->current_network;
> >  
> > -	if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > -	    (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > -	    (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > -	    (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > -	    (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > +	if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > +	    (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > +	    (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > +	    (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > +	    (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> >  	    (net->ralink_cap_exist))
> >  		retValue = true;
> > -	else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > +	else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > +		 ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > +		 ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
> >  		 (net->broadcom_cap_exist))
> >  		retValue = true;
> >  	else if (net->bssht.bd_rt2rt_aggregation)
> > @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee)
> >  			pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
> >  	} else if (net->broadcom_cap_exist) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > -	} else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> > +	} else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > +		   ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > +		   ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > -	} else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > -		 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > -		 (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > -		 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > -		 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > -		  net->ralink_cap_exist) {
> > +	} else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > +		   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > +		   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > +		   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > +		   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > +		   net->ralink_cap_exist) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
> >  	} else if ((net->atheros_cap_exist) ||
> > -		(memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> > -		(memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> > +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> > +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> > -	} else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> > -		  net->cisco_cap_exist) {
> > +	} else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
> > +		   net->cisco_cap_exist) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
> > -	} else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
> > -		  net->marvell_cap_exist) {
> > +	} else if ((ether_oui_equal(net->bssid, LINKSYS_MARVELL_4400N) == 0) ||
> > +		   net->marvell_cap_exist) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
> >  	} else if (net->airgo_cap_exist) {
> >  		pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO;
> > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> > index 2e5debc0373c..6a1a63168319 100644
> > --- a/include/linux/etherdevice.h
> > +++ b/include/linux/etherdevice.h
> > @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
> >  #endif
> >  }
> >  
> > +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> > +{
> > +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> > +}
> 
> Staging drivers are stand-alone, we can not add code outside of the
> driver directory in these patches, sorry.
> 
Okay Sir. When I tried to add static inline bool line in current file, it
showed errors which I was not able to rectify, but when I added that
line to include/linux/etherdevice.h file, and replaced memcmp with
ether_oui_equal, it worked fine.
I may be wrong in application. May I know how to resolve this?

> And as Dan said, this is wrong formatting, did you run checkpatch.pl on
> your changes?
>
Yes Sir, I ran checkpatch.pl, on both files, it showed no errors
against the changes I made.

> thanks,
> 
> greg k-h

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

* Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-15 13:42     ` Mitali Borkar
@ 2021-04-15 14:02       ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2021-04-15 14:02 UTC (permalink / raw)
  To: Mitali Borkar
  Cc: davem, kuba, linux-staging, linux-kernel, outreachy-kernel, mitali_s

On Thu, Apr 15, 2021 at 07:12:47PM +0530, Mitali Borkar wrote:
> On Wed, Apr 14, 2021 at 10:16:59AM +0200, Greg KH wrote:
> > On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > > Added a generic function of static inline bool in
> > > include/linux/etherdevice.h to replace memcmp with
> > > ether_oui_equal throughout the execution.
> > > Corrected the misspelled words in this file.
> > > 
> > > Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> > > ---
> > >  
> > > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > > ether_oui_equal.
> > > 
> > >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
> > >  include/linux/etherdevice.h               |  5 +++
> > >  2 files changed, 29 insertions(+), 24 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > index ec6b46166e84..ce58feb2af9a 100644
> > > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> > >  	 810, 720, 810, 900, 900, 990} }
> > >  };
> > >  
> > > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> > >  
> > >  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
> > >  
> > > @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> > >  	bool			retValue = false;
> > >  	struct rtllib_network *net = &ieee->current_network;
> > >  
> > > -	if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > > -	    (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > > -	    (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > > -	    (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > > -	    (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > > +	if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > > +	    (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > > +	    (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > > +	    (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > > +	    (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > >  	    (net->ralink_cap_exist))
> > >  		retValue = true;
> > > -	else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > > +	else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > > +		 ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > > +		 ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
> > >  		 (net->broadcom_cap_exist))
> > >  		retValue = true;
> > >  	else if (net->bssht.bd_rt2rt_aggregation)
> > > @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee)
> > >  			pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
> > >  	} else if (net->broadcom_cap_exist) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > > -	} else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > -		 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > -		 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> > > +	} else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > > +		   ether_oui_equal(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > > +		   ether_oui_equal(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > > -	} else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > > -		 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > > -		 (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > > -		 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > > -		 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > > -		  net->ralink_cap_exist) {
> > > +	} else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > > +		   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > > +		   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > > +		   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > > +		   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > > +		   net->ralink_cap_exist) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
> > >  	} else if ((net->atheros_cap_exist) ||
> > > -		(memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> > > -		(memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> > > +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> > > +		   (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> > > -	} else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> > > -		  net->cisco_cap_exist) {
> > > +	} else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
> > > +		   net->cisco_cap_exist) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
> > > -	} else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
> > > -		  net->marvell_cap_exist) {
> > > +	} else if ((ether_oui_equal(net->bssid, LINKSYS_MARVELL_4400N) == 0) ||
> > > +		   net->marvell_cap_exist) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
> > >  	} else if (net->airgo_cap_exist) {
> > >  		pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO;
> > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> > > index 2e5debc0373c..6a1a63168319 100644
> > > --- a/include/linux/etherdevice.h
> > > +++ b/include/linux/etherdevice.h
> > > @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
> > >  #endif
> > >  }
> > >  
> > > +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> > > +{
> > > +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> > > +}
> > 
> > Staging drivers are stand-alone, we can not add code outside of the
> > driver directory in these patches, sorry.
> > 
> Okay Sir. When I tried to add static inline bool line in current file, it
> showed errors which I was not able to rectify,

What errors was shown?

What did you do to try to fix it?

There should not be any need to add this to a kernel-wide header file
for a tiny staging driver.

thanks,

greg k-h

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

* Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal
  2021-04-14  7:55   ` Dan Carpenter
@ 2021-04-15 14:03     ` Mitali Borkar
  0 siblings, 0 replies; 12+ messages in thread
From: Mitali Borkar @ 2021-04-15 14:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: gregkh, davem, kuba, linux-staging, linux-kernel,
	outreachy-kernel, mitali_s

On Wed, Apr 14, 2021 at 10:55:25AM +0300, Dan Carpenter wrote:
> On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > Added a generic function of static inline bool in
> > include/linux/etherdevice.h to replace memcmp with
> > ether_oui_equal throughout the execution.
> > Corrected the misspelled words in this file.
> > 
> > Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> > ---
> >  
> > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > ether_oui_equal.
> > 
> >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++++++++++------------
> >  include/linux/etherdevice.h               |  5 +++
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is networking code and not staging code, but the netdev mailing
> list isn't CC'd.
>
I didn't knew mail id then, I will look into this,

> >  2 files changed, 29 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > index ec6b46166e84..ce58feb2af9a 100644
> > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> >  	 810, 720, 810, 900, 900, 990} }
> >  };
> >  
> > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> 
> Please pull this spelling fix into its own patch.
> 
Okay Sir.

> [ snip ]
> 
> > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> > index 2e5debc0373c..6a1a63168319 100644
> > --- a/include/linux/etherdevice.h
> > +++ b/include/linux/etherdevice.h
> > @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
> >  #endif
> >  }
> >  
> > +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> > +{
> > +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> > +}
> 
> The indenting is messed up on this.
>
OKay Sir, I am looking into this.

> regards,
> dan carpenter
> 

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

end of thread, other threads:[~2021-04-15 14:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14  6:54 Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Mitali Borkar
2021-04-14  6:55 ` [PATCH v2 1/5] staging: rtl8192e: add spaces around binary operators Mitali Borkar
2021-04-14  6:55 ` [PATCH v2 2/5] staging: rtl8192e: remove unnecessary blank line before brace Mitali Borkar
2021-04-14  6:55 ` [PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace Mitali Borkar
2021-04-14  6:56 ` [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal Mitali Borkar
2021-04-14  7:55   ` Dan Carpenter
2021-04-15 14:03     ` Mitali Borkar
2021-04-14  8:16   ` Greg KH
2021-04-15 13:42     ` Mitali Borkar
2021-04-15 14:02       ` Greg KH
2021-04-14  6:56 ` [PATCH v2 5/5] staging: rtl8192e: removed multiple blank lines Mitali Borkar
2021-04-14  8:20 ` Subject: [PATCH v2 0/5] staging: rtl8192e: CLeanup patchset for style issues in rtl819x_Y.c files Greg KH

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).