staging: rtl8723bs: os_dep: ioctl_linux.c: Fix formatting issues
cover staging: rtl8723bs: os_dep: ioctl_linux.c: Fix formatting issues
This patchset:
-Removes spaces and adds right number of tabs. -Removes spaces before square brackets. -Avoids camelcase variable names. -Removes space before semicolon. -Aligns to open parenthesis.
Payal Kshirsagar (9):
staging: rtl8723bs: os_dep: ioctl_linux.c: Fix indentation issue.
staging: rtl8723bs: os_dep: ioctl_linux.c: space prohibited before
square brackets
staging: rtl8723bs: os_dep: ioctl_linux.c: "foo* bar" should be "foo
*bar"
staging: rtl8723bs: os_dep: ioctl_linux.c: "(foo*)" should be "(foo
*)" staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase
"blInserted"
staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "intReturn"
staging: rtl8723bs: os_dep: ioctl_linux.c: space prohibited before
semicolon
staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "pPMK"
staging: rtl8723bs: os_dep: ioctl_linux.c: Alignment should match open
parenthesis
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 103 ++++++++++++------------- 1 file changed, 50 insertions(+), 53 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/9 staging: rtl8723bs: os_dep: ioctl_linux.c: Fix indentation issue.
To fix the indentation issue remove spaces and add tabs.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 85 +++++++++++++------------- 1 file changed, 41 insertions(+), 44 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +41 -44
@@ -939,30 +939,30 @@ static int rtw_wx_get_mode(struct net_device *dev, struct iw_request_info *a,static int rtw_wx_set_pmkid (struct net_device *dev, -struct iw_request_info *a, -union iwreq_data *wrqu,char *extra) +struct iw_request_info *a, +union iwreq_data *wrqu,char *extra) {struct adapter *padapter = (struct adapter *)rtw_netdev_priv (dev); -u8 j, blInserted = false; -int intReturn = false; +u8 j, blInserted = false; +int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa * pPMK = (struct iw_pmksa *)extra; -u8 strZeroMacAddress[ETH_ALEN ] = {0x00 }; -u8 strIssueBssid[ETH_ALEN ] = {0x00 }; +struct iw_pmksa * pPMK = (struct iw_pmksa *)extra; +u8 strZeroMacAddress[ETH_ALEN ] = {0x00 }; +u8 strIssueBssid[ETH_ALEN ] = {0x00 };/* -There are the BSSID information in the bssid.sa_data array. -If cmd is IW_PMKSA_FLUSH, it means the wpa_suppplicant wants to clear all the PMKID information. -If cmd is IW_PMKSA_ADD, it means the wpa_supplicant wants to add a PMKID/BSSID to driver. -If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID/BSSID from driver. -*/ +There are the BSSID information in the bssid.sa_data array. +If cmd is IW_PMKSA_FLUSH, it means the wpa_suppplicant wants to clear all the PMKID information. +If cmd is IW_PMKSA_ADD, it means the wpa_supplicant wants to add a PMKID/BSSID to driver. +If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID/BSSID from driver. +*/ memcpy (strIssueBssid, pPMK->bssid.sa_data,ETH_ALEN ); -if (pPMK->cmd ==IW_PMKSA_ADD ) { -DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" ); -if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) +if (pPMK->cmd ==IW_PMKSA_ADD ) { +DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" ); +if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN ))return intReturn; -else +else intReturn = true; blInserted = false;
@@ -971,46 +971,43 @@ static int rtw_wx_set_pmkid(struct net_device *dev,for (j =0 ; j<NUM_PMKID_CACHE ; j++) {if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => rewrite with new PMKID. */ -DBG_871X ("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" ); - +DBG_871X ("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" );memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); - psecuritypriv->PMKIDList[ j ].bUsed = true; + psecuritypriv->PMKIDList[ j ].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; blInserted = true;break ; } - } - -if (!blInserted) { -/* Find a new entry */ -DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , - psecuritypriv->PMKIDIndex); - -memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN ); -memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); + } - psecuritypriv->PMKIDList[ psecuritypriv->PMKIDIndex ].bUsed = true; - psecuritypriv->PMKIDIndex++ ; -if (psecuritypriv->PMKIDIndex ==16 ) - psecuritypriv->PMKIDIndex =0 ; +if (!blInserted) { +/* Find a new entry */ +DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , + psecuritypriv->PMKIDIndex); +memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN ); +memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); + psecuritypriv->PMKIDList[ psecuritypriv->PMKIDIndex ].bUsed = true; + psecuritypriv->PMKIDIndex++ ; +if (psecuritypriv->PMKIDIndex ==16 ) + psecuritypriv->PMKIDIndex =0 ; } - }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) { -DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); - intReturn = true; + }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) { +DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); + intReturn = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ -eth_zero_addr (psecuritypriv->PMKIDList[j].Bssid); - psecuritypriv->PMKIDList[ j ].bUsed = false; +eth_zero_addr (psecuritypriv->PMKIDList[j].Bssid); + psecuritypriv->PMKIDList[ j ].bUsed = false;break ; } - } - }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) { -DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); -memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); - psecuritypriv->PMKIDIndex =0 ; - intReturn = true; - } + } + }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) { +DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); +memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); + psecuritypriv->PMKIDIndex =0 ; + intReturn = true; + }return intReturn; }
Signature · 1 line
2.7.4
PATCH 2/9 staging: rtl8723bs: os_dep: ioctl_linux.c: space prohibited before square brackets
In reply to Payal KshirsagarRemove space before square open and close bracket to fix issue - space prohibited before square brackets.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +6 -6
@@ -947,8 +947,8 @@ static int rtw_wx_set_pmkid(struct net_device *dev,int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa * pPMK = (struct iw_pmksa *)extra; -u8 strZeroMacAddress[ETH_ALEN ] = {0x00 }; -u8 strIssueBssid[ETH_ALEN ] = {0x00 }; +u8 strZeroMacAddress[ETH_ALEN ] = {0x00 }; +u8 strIssueBssid[ETH_ALEN ] = {0x00 };/* There are the BSSID information in the bssid.sa_data array.
@@ -973,7 +973,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,/* BSSID is matched, the same AP => rewrite with new PMKID. */ DBG_871X ("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" );memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); - psecuritypriv->PMKIDList[ j ].bUsed = true; + psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; blInserted = true;break ;
@@ -986,7 +986,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, psecuritypriv->PMKIDIndex);memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN );memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); - psecuritypriv->PMKIDList[ psecuritypriv->PMKIDIndex ].bUsed = true; + psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true; psecuritypriv->PMKIDIndex++ ;if (psecuritypriv->PMKIDIndex ==16 ) psecuritypriv->PMKIDIndex =0 ;
@@ -998,13 +998,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ eth_zero_addr (psecuritypriv->PMKIDList[j].Bssid); - psecuritypriv->PMKIDList[ j ].bUsed = false; + psecuritypriv->PMKIDList[j].bUsed = false;break ; } } }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); -memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); +memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex =0 ; intReturn = true; }
Signature · 1 line
2.7.4
PATCH 3/9 staging: rtl8723bs: os_dep: ioctl_linux.c: "foo* bar" should be "foo *bar"
In reply to Payal KshirsagarFix issue - "foo* bar" should be "foo *bar".
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -946,7 +946,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,u8 j, blInserted = false;int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa * pPMK = (struct iw_pmksa *)extra; +struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };u8 strIssueBssid[ETH_ALEN ] = {0x00 };
Signature · 1 line
2.7.4
PATCH 4/9 staging: rtl8723bs: os_dep: ioctl_linux.c: "(foo*)" should be "(foo *)"
In reply to Payal KshirsagarFix issue - "(foo*)" should be "(foo *)".
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -946,7 +946,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,u8 j, blInserted = false;int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa *pPMK = (struct iw_pmksa *)extra; +struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };u8 strIssueBssid[ETH_ALEN ] = {0x00 };
Signature · 1 line
2.7.4
PATCH 5/9 staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "blInserted"
In reply to Payal KshirsagarChange variable name "blInserted" to "bl_insetred" to avoid camelcase style issue.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +4 -4
@@ -943,7 +943,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); -u8 j, blInserted = false; +u8 j, bl_inserted = false;int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;
@@ -965,7 +965,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,else intReturn = true; - blInserted = false; + bl_inserted = false;/* overwrite PMKID */ for (j =0 ; j<NUM_PMKID_CACHE ; j++) {
@@ -975,12 +975,12 @@ static int rtw_wx_set_pmkid(struct net_device *dev,memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; - blInserted = true; + bl_inserted = true;break ; } } -if (!blInserted) { +if (!bl_inserted) {/* Find a new entry */ DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , psecuritypriv->PMKIDIndex);
Signature · 1 line
2.7.4
PATCH 6/9 staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "intReturn"
In reply to Payal KshirsagarChange variable name "intReturn" to "ret" to avoid camelcase style issue.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +6 -6
@@ -944,7 +944,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, {struct adapter *padapter = (struct adapter *)rtw_netdev_priv (dev);u8 j, bl_inserted = false; -int intReturn = false; +int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };
@@ -961,9 +961,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return intReturn; +return ret;else - intReturn = true; + ret = true; bl_inserted = false;
@@ -993,7 +993,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, } }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); - intReturn = true; + ret = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
@@ -1006,9 +1006,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex =0 ; - intReturn = true; + ret = true; } -return intReturn; +return ret; } static int rtw_wx_get_sens(struct net_device *dev,
Signature · 1 line
2.7.4
PATCH 7/9 staging: rtl8723bs: os_dep: ioctl_linux.c: space prohibited before semicolon
In reply to Payal KshirsagarRemove space before semicolon.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -987,7 +987,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN );memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true; - psecuritypriv->PMKIDIndex++ ; + psecuritypriv->PMKIDIndex++;if (psecuritypriv->PMKIDIndex ==16 ) psecuritypriv->PMKIDIndex =0 ; }
Signature · 1 line
2.7.4
PATCH 8/9 staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "pPMK"
In reply to Payal KshirsagarChange variable name "pPMK" to "PMK"
to avoid camelcase style issue.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +7 -7
@@ -946,7 +946,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,u8 j, bl_inserted = false;int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa *pPMK = (struct iw_pmksa *)extra; +struct iw_pmksa *PMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };u8 strIssueBssid[ETH_ALEN ] = {0x00 };
@@ -957,8 +957,8 @@ static int rtw_wx_set_pmkid(struct net_device *dev,If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID/BSSID from driver. */ -memcpy (strIssueBssid, pPMK->bssid.sa_data,ETH_ALEN ); -if (pPMK->cmd ==IW_PMKSA_ADD ) { +memcpy (strIssueBssid,PMK ->bssid.sa_data,ETH_ALEN ); +if (PMK ->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN ))return ret;
@@ -972,7 +972,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => rewrite with new PMKID. */ DBG_871X ("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" ); -memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); +memcpy (psecuritypriv->PMKIDList[j].PMKID,PMK ->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; bl_inserted = true;
@@ -985,13 +985,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev,DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , psecuritypriv->PMKIDIndex);memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN ); -memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); +memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID,PMK ->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true; psecuritypriv->PMKIDIndex++;if (psecuritypriv->PMKIDIndex ==16 ) psecuritypriv->PMKIDIndex =0 ; } - }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) { + }else if (PMK ->cmd ==IW_PMKSA_REMOVE ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); ret = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {
@@ -1002,7 +1002,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,break ; } } - }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) { + }else if (PMK ->cmd ==IW_PMKSA_FLUSH ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex =0 ;
Signature · 1 line
2.7.4
PATCH 9/9 staging: rtl8723bs: os_dep: ioctl_linux.c: Alignment should match open parenthesis
In reply to Payal KshirsagarAlign code to open parenthesis.
--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -983,7 +983,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (!bl_inserted) {/* Find a new entry */ DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , - psecuritypriv->PMKIDIndex); + psecuritypriv->PMKIDIndex);memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN );memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID,PMK ->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true;
Signature · 1 line
2.7.4
Re: [Outreachy kernel] [PATCH 8/9] staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "pPMK"
In reply to Payal KshirsagarQuoted 2 lines · Payal Kshirsagar
Change variable name "pPMK" to "PMK"
to avoid camelcase style issue.
The p is actually hungarian notation.
It would be good to lowercase the variable as well (pmk). Normally only macros are in all upper case.
julia
Quoted 74 lines
Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +7
-8@@ -946,7 +946,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,u8 j, bl_inserted = false;int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa *pPMK = (struct iw_pmksa *)extra; +struct iw_pmksa *PMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };u8 strIssueBssid[ETH_ALEN ] = {0x00 };@@ -957,8 +957,8 @@ static int rtw_wx_set_pmkid(struct net_device *dev,If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID/BSSID from driver. */ -memcpy (strIssueBssid, pPMK->bssid.sa_data,ETH_ALEN ); -if (pPMK->cmd ==IW_PMKSA_ADD ) { +memcpy (strIssueBssid,PMK ->bssid.sa_data,ETH_ALEN ); +if (PMK ->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN ))return ret;@@ -972,7 +972,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => rewrite with new PMKID. */ DBG_871X ("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" ); -memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); +memcpy (psecuritypriv->PMKIDList[j].PMKID,PMK ->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; bl_inserted = true;@@ -985,13 +985,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev,DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , psecuritypriv->PMKIDIndex);memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid,ETH_ALEN ); -memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid,IW_PMKID_LEN ); +memcpy (psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID,PMK ->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true; psecuritypriv->PMKIDIndex++;if (psecuritypriv->PMKIDIndex ==16 ) psecuritypriv->PMKIDIndex =0 ; } - }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) { + }else if (PMK ->cmd ==IW_PMKSA_REMOVE ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); ret = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {@@ -1002,7 +1002,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,break ; } } - }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) { + }else if (PMK ->cmd ==IW_PMKSA_FLUSH ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex =0 ; --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/2494c4c09f776e7c9b4c80bbeea8d8973a5b69e4.1554016131.git.payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 6/9] staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "intReturn"
In reply to Payal KshirsagarQuoted 2 lines · Payal Kshirsagar
Change variable name "intReturn" to "ret" to avoid camelcase style issue.
This is hungarian notation too. Using ret was a good idea.
julia
Quoted 62 lines
Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +6
-7@@ -944,7 +944,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, {struct adapter *padapter = (struct adapter *)rtw_netdev_priv (dev);u8 j, bl_inserted = false; -int intReturn = false; +int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };@@ -961,9 +961,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return intReturn; +return ret;else - intReturn = true; + ret = true; bl_inserted = false;@@ -993,7 +993,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, } }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); - intReturn = true; + ret = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {if (!memcmp (psecuritypriv->PMKIDList[j].Bssid, strIssueBssid,ETH_ALEN )) {/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ @@ -1006,9 +1006,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" );memset (&psecuritypriv->PMKIDList[0 ],0x00 ,sizeof (RT_PMKID_LIST ) *NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex =0 ; - intReturn = true; + ret = true; } -return intReturn; +return ret; } static int rtw_wx_get_sens(struct net_device *dev, --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/97ba5a38e386011ce2c46eb9668d44ef257da020.1554016131.git.payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 5/9] staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "blInserted"
In reply to Payal KshirsagarQuoted 2 lines · Payal Kshirsagar
Change variable name "blInserted" to "
bl_insetred" to avoid camelcase style issue.
No, the bl is hungarian notation (bool long?). Just use inserted. Also, use the correct spelling of inserted in the log message.
julia
Quoted 53 lines
Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +4
-5@@ -943,7 +943,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); -u8 j, blInserted = false; +u8 j, bl_inserted = false;int intReturn = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;@@ -965,7 +965,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,else intReturn = true; - blInserted = false; + bl_inserted = false;/* overwrite PMKID */ for (j =0 ; j<NUM_PMKID_CACHE ; j++) {@@ -975,12 +975,12 @@ static int rtw_wx_set_pmkid(struct net_device *dev,memcpy (psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid,IW_PMKID_LEN ); psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; - blInserted = true; + bl_inserted = true;break ; } } -if (!blInserted) { +if (!bl_inserted) {/* Find a new entry */ DBG_871X ("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n" , psecuritypriv->PMKIDIndex); --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/262f9fa05d845ba0b407eb2f887ffa62d546c54c.1554016131.git.payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 6/9] staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "intReturn"
In reply to Julia LawallQuoted 9 lines · Julia Lawall
Quoted 2 lines · Payal Kshirsagar
Change variable name "intReturn" to "ret" to avoid camelcase style issue.
This is hungarian notation too. Using ret was a good idea.
Thank you :)
payal
Quoted 84 lines
julia
Review
Quoted 7 lines
Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.cQuoted 25 lines
index 99e02c4..98a91ce 100644
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +3
-3@@ -944,7 +944,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, {struct adapter *padapter = (struct adapter *)rtw_netdev_priv (dev);u8 j, bl_inserted = false; -int intReturn = false; +int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv;struct iw_pmksa *pPMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };@@ -961,9 +961,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,if (pPMK->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN )) -return intReturn; +return ret;else - intReturn = true; + ret = true; bl_inserted = false;drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 998
Quoted 7 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1@@ -993,7 +993,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, } } else if (pPMK->cmd == IW_PMKSA_REMOVE) { DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n"); - intReturn = true; + ret = true; for (j = 0 ; j<NUM_PMKID_CACHE; j++) { if (!memcmp(psecuritypriv->PMKIDList[j].Bssid,strIssueBssid,
ETH_ALEN)) {drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 999
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 1007
Quoted 3 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0@@ -1006,9 +1006,9 @@ static int rtw_wx_set_pmkid(struct net_device *dev,DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); memset(&psecuritypriv->PMKIDList[0], 0x00,
sizeof(RT_PMKID_LIST)*NUM_PMKID_CACHE);Quoted 12 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +2
-3psecuritypriv->PMKIDIndex =0 ; - intReturn = true; + ret = true; } -return intReturn; +return ret; } static int rtw_wx_get_sens(struct net_device *dev, --2.7.4
Quoted 2 lines
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
--
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/alpine.DEB.2.21.1903311103540.2578%40hadrien
.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 8/9] staging: rtl8723bs: os_dep: ioctl_linux.c: Avoid CamelCase "pPMK"
In reply to Julia LawallQuoted 4 lines · Julia Lawall
On Sun, 31 Mar 2019, Payal Kshirsagar wrote:
Quoted 8 lines
Quoted 2 lines
Change variable name "pPMK" to "PMK"
to avoid camelcase style issue.The p is actually hungarian notation.
It would be good to lowercase the variable as well (pmk). Normally only macros are in all upper case.
Okay I will send v2 for this patchset with corrections. thanks,
payal
julia
Quoted 96 lines
Review
Quoted 8 lines
Signed-off-by Payal Kshirsagar <[email protected]>--- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.cQuoted 13 lines
index 9f085a3..fbde2eb 100644
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1@@ -946,7 +946,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,u8 j, bl_inserted = false;int ret = false;struct security_priv *psecuritypriv = &padapter->securitypriv; -struct iw_pmksa *pPMK = (struct iw_pmksa *)extra; +struct iw_pmksa *PMK = (struct iw_pmksa *)extra;u8 strZeroMacAddress[ETH_ALEN ] = {0x00 };u8 strIssueBssid[ETH_ALEN ] = {0x00 };drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 957
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0@@ -957,8 +957,8 @@ static int rtw_wx_set_pmkid(struct net_device *dev, If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants toremove a PMKID/BSSID from driver.
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 972
Quoted 11 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +2
-2*/ -memcpy (strIssueBssid, pPMK->bssid.sa_data,ETH_ALEN ); -if (pPMK->cmd ==IW_PMKSA_ADD ) { +memcpy (strIssueBssid,PMK ->bssid.sa_data,ETH_ALEN ); +if (PMK ->cmd ==IW_PMKSA_ADD ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" );if (!memcmp (strIssueBssid, strZeroMacAddress,ETH_ALEN ))return ret;@@ -972,7 +972,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, if (!memcmp(psecuritypriv->PMKIDList[j].Bssid,strIssueBssid,
ETH_ALEN)) {drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 973
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0/* BSSID is matched, the same AP => rewrite with new PMKID. */
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 974
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0DBG_871X("[rtw_wx_set_pmkid] BSSID existsin the PMKList.\n");
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 975
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-1- memcpy(psecuritypriv->PMKIDList[j].PMKID,
pPMK->pmkid,IW_PMKID_LEN);drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 975
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-0+ memcpy(psecuritypriv->PMKIDList[j].PMKID,
PMK->pmkid,IW_PMKID_LEN);drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 985
Quoted 5 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0psecuritypriv->PMKIDList[j].bUsed = true; psecuritypriv->PMKIDIndex = j+1 ; bl_inserted = true;@@ -985,13 +985,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev, DBG_871X("[rtw_wx_set_pmkid] Use the new entryindex = %d for this PMKID.\n",
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 987
Quoted 2 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-0psecuritypriv->PMKIDIndex);memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid,
strIssueBssid,ETH_ALEN);drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 988
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-1-memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID,
pPMK->pmkid,IW_PMKID_LEN);drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 988
Quoted 1 line
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-0+memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID,
PMK->pmkid,IW_PMKID_LEN);Quoted 1 line
psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true;
Quoted 10 lines
psecuritypriv->PMKIDIndex++; if (psecuritypriv->PMKIDIndex == 16) psecuritypriv->PMKIDIndex = 0; }drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1- }else if (pPMK->cmd ==IW_PMKSA_REMOVE ) { + }else if (PMK ->cmd ==IW_PMKSA_REMOVE ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); ret = true;for (j =0 ; j<NUM_PMKID_CACHE ; j++) {drivers/staging/rtl8723bs/os_dep/ioctl_linux.c static int rtw_wx_set_pmkid(struct net_device *dev, · line 1007
Quoted 7 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1
-1@@ -1002,7 +1002,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,break ; } } - }else if (pPMK->cmd ==IW_PMKSA_FLUSH ) { + }else if (PMK ->cmd ==IW_PMKSA_FLUSH ) {DBG_871X ("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); memset(&psecuritypriv->PMKIDList[0], 0x00,
sizeof(RT_PMKID_LIST)*NUM_PMKID_CACHE);Quoted 6 lines
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0
-1psecuritypriv->PMKIDIndex =0 ; --2.7.4
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.