[PATCH] staging: gasket: Convert symbolic permission to octal

2020-06-25 Thread Brooke Basile
Fixing checkpatch WARNING: Symbolic permissions 'S_IRUGO' are not preferred. 
Consider using octal permissions '0444'.

Signed-off-by: Brooke Basile 
---
 drivers/staging/gasket/gasket_sysfs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gasket/gasket_sysfs.h 
b/drivers/staging/gasket/gasket_sysfs.h
index ab5aa351d555..eb0fd3b0490f 100644
--- a/drivers/staging/gasket/gasket_sysfs.h
+++ b/drivers/staging/gasket/gasket_sysfs.h
@@ -71,7 +71,7 @@ struct gasket_sysfs_attribute {
 
 #define GASKET_SYSFS_RO(_name, _show_function, _attr_type) 
\
{  \
-   .attr = __ATTR(_name, S_IRUGO, _show_function, NULL),  \
+   .attr = __ATTR(_name, 0444, _show_function, NULL), \
.data.attr_type = _attr_type   \
}
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] staging: rtl8188eu: Fix comment formatting

2020-06-26 Thread Brooke Basile
Fix the following checkpatch warnings:
WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Brooke Basile 
---
 .../staging/rtl8188eu/core/rtw_ieee80211.c| 26 ---
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index caf600eba03b..a27dce7f30b3 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -139,9 +139,11 @@ u8 *rtw_set_ie
return pbuf + len + 2;
 }
 
-/*
-index: the information element id index, limit is the limit for search
--*/
+/*
+ * 
+ * index: the information element id index, limit is the limit for search
+ * 
+ */
 u8 *rtw_get_ie(u8 *pbuf, int index, uint *len, int limit)
 {
int tmp, i;
@@ -680,9 +682,11 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, 
uint elen,
 {
unsigned int oui;
 
-   /* first 3 bytes in vendor specific information element are the IEEE
+   /*
+* first 3 bytes in vendor specific information element are the IEEE
 * OUI of the vendor. The following byte is used a vendor specific
-* sub-type. */
+* sub-type.
+*/
if (elen < 4) {
if (show_errors) {
DBG_88E("short vendor specific information element 
ignored (len=%lu)\n",
@@ -694,12 +698,16 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, 
uint elen,
oui = RTW_GET_BE24(pos);
switch (oui) {
case OUI_MICROSOFT:
-   /* Microsoft/Wi-Fi information elements are further typed and
-* subtyped */
+   /*
+* Microsoft/Wi-Fi information elements are further typed and
+* subtyped
+*/
switch (pos[3]) {
case 1:
-   /* Microsoft OUI (00:50:F2) with OUI Type 1:
-* real WPA information element */
+   /*
+* Microsoft OUI (00:50:F2) with OUI Type 1:
+* real WPA information element
+*/
elems->wpa_ie = pos;
elems->wpa_ie_len = elen;
break;
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: rtl8188eu: Fix strings split across lines

2020-06-26 Thread Brooke Basile
Fix the following checkpatch warning:
WARNING: quoted string split across lines

Signed-off-by: Brooke Basile 
---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index a27dce7f30b3..44a25d29f1d3 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -381,8 +381,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int 
*group_cipher, int *pairwis
left -= 2;
 
if (count == 0 || left < count * WPA_SELECTOR_LEN) {
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie 
count botch (pairwise), "
-   "count %u left %u", __func__, 
count, left));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie 
count botch (pairwise), count %u left %u",
+   __func__, count, left));
return _FAIL;
}
 
@@ -448,8 +448,8 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int 
*group_cipher, int *pairwi
left -= 2;
 
if (count == 0 || left < count * RSN_SELECTOR_LEN) {
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie 
count botch (pairwise), "
-"count %u left %u", __func__, 
count, left));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie 
count botch (pairwise), count %u left %u",
+   __func__, count, left));
return _FAIL;
}
 
@@ -943,8 +943,8 @@ static int rtw_get_cipher_info(struct wlan_network 
*pnetwork)
pnetwork->BcnInfo.pairwise_cipher = 
pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher;
pnetwork->BcnInfo.is_8021x = is8021x;
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, 
("%s: pnetwork->pairwise_cipher: %d,"
-   "pnetwork->group_cipher 
is %d, is_8021x is %d", __func__, pnetwork->BcnInfo.pairwise_cipher,
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, 
("%s: pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_8021x is 
%d",
+   __func__, 
pnetwork->BcnInfo.pairwise_cipher,

pnetwork->BcnInfo.group_cipher, pnetwork->BcnInfo.is_8021x));
ret = _SUCCESS;
}
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: rtl8188eu: Replace function name with __func__

2020-06-26 Thread Brooke Basile
Fix the following checkpatch warning:
WARNING: Prefer using '"%s...", __func__' to using 'rtw_get_bcn_info', 
this function's name, in a string

Signed-off-by: Brooke Basile 
---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index bf6b2fe9735f..0c43c0dcf95c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -986,10 +986,10 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
if (bencrypt)
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WEP;
}
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: 
pnetwork->encryp_protocol is %x\n",
-pnetwork->BcnInfo.encryp_protocol));
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: 
pnetwork->encryp_protocol is %x\n",
-pnetwork->BcnInfo.encryp_protocol));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: 
pnetwork->encryp_protocol is %x\n",
+__func__, pnetwork->BcnInfo.encryp_protocol));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: 
pnetwork->encryp_protocol is %x\n",
+__func__, pnetwork->BcnInfo.encryp_protocol));
rtw_get_cipher_info(pnetwork);
 
/* get bwmode and ch_offset */
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: rtl8188eu: Fix indentation

2020-06-26 Thread Brooke Basile
Fix the following checkpatch warning:
WARNING: suspect code indent for conditional statements (16, 32)

Signed-off-by: Brooke Basile 
---
 .../staging/rtl8188eu/core/rtw_ieee80211.c| 30 +--
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 44a25d29f1d3..bf6b2fe9735f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -494,23 +494,23 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, 
u16 *rsn_len, u8 *wpa_ie
authmode = in_ie[cnt];
 
if ((authmode == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt + 2], 
&wpa_oui[0], 4))) {
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
-("\n rtw_get_wpa_ie: sec_idx =%d 
in_ie[cnt+1]+2 =%d\n",
-sec_idx, in_ie[cnt + 1] + 2));
-
-   if (wpa_ie) {
-   memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 
1] + 2);
-
-   for (i = 0; i < (in_ie[cnt + 1] + 2); i 
+= 8) {
-   
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
-("\n 
%2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
-wpa_ie[i], wpa_ie[i + 
1], wpa_ie[i + 2], wpa_ie[i + 3], wpa_ie[i + 4],
-wpa_ie[i + 5], 
wpa_ie[i + 6], wpa_ie[i + 7]));
-   }
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
+("\n rtw_get_wpa_ie: sec_idx =%d 
in_ie[cnt+1]+2 =%d\n",
+sec_idx, in_ie[cnt + 1] + 2));
+
+   if (wpa_ie) {
+   memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
+
+   for (i = 0; i < (in_ie[cnt + 1] + 2); i += 8) {
+   RT_TRACE(_module_rtl871x_mlme_c_, 
_drv_info_,
+("\n 
%2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
+wpa_ie[i], wpa_ie[i + 1], 
wpa_ie[i + 2], wpa_ie[i + 3], wpa_ie[i + 4],
+wpa_ie[i + 5], wpa_ie[i + 6], 
wpa_ie[i + 7]));
}
+   }
 
-   *wpa_len = in_ie[cnt + 1] + 2;
-   cnt += in_ie[cnt + 1] + 2;  /* get next */
+   *wpa_len = in_ie[cnt + 1] + 2;
+   cnt += in_ie[cnt + 1] + 2;  /* get next */
} else {
if (authmode == _WPA2_IE_ID_) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: rtl8188eu: Replace function name with __func__

2020-06-29 Thread Brooke Basile
Fix the following checkpatch warning:
WARNING: Prefer using '"%s...", __func__' to using 'rtw_get_bcn_info', 
this function's name, in a string

Signed-off-by: Brooke Basile 
---
Changes in v2:
- This should fix the previous issue that caused the patch to
  fail to apply. 

 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 3316059238e0..b80273611fb8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -987,10 +987,10 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
if (bencrypt)
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WEP;
}
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: 
pnetwork->encryp_protocol is %x\n",
-  
pnetwork->BcnInfo.encryp_protocol));
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: 
pnetwork->encryp_protocol is %x\n",
-  
pnetwork->BcnInfo.encryp_protocol));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: 
pnetwork->encryp_protocol is %x\n",
+   __func__, 
pnetwork->BcnInfo.encryp_protocol));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: 
pnetwork->encryp_protocol is %x\n",
+   __func__, 
pnetwork->BcnInfo.encryp_protocol));
rtw_get_cipher_info(pnetwork);
 
/* get bwmode and ch_offset */
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel