Skip to contentSkip to conversation

Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue

PATCH In review Jaya Durga 2 participants 2 messages May 8, 2017 – May 9, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH 4/4 Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue

fixed warning line over 80 characters coding style issue

---
 drivers/staging/rtl8712/ieee80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/ieee80211.c +3 -1
index 42cb46c..a7152df 100644
@@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
 		if (pbuf) {
 			/*check if oui matches...*/
-			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
+			if (memcmp(
+				(pbuf + 2), wpa_oui_type,
+				sizeof(wpa_oui_type)))
 				goto check_next_ie;
 			/*check version...*/
 			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
Signature · 1 line
1.9.1
#1 lore raw
Quoted 12 lines · Jaya Durga

fixed warning line over 80 characters coding style issue

---
 drivers/staging/rtl8712/ieee80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/ieee80211.c +0 -0
index 42cb46c..a7152df 100644

drivers/staging/rtl8712/ieee80211.c unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) · line 230

Quoted 10 lines
drivers/staging/rtl8712/ieee80211.c +3 -1
@@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
 		if (pbuf) {
 			/*check if oui matches...*/
-			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
+			if (memcmp(
+				(pbuf + 2), wpa_oui_type,
+				sizeof(wpa_oui_type)))
 				goto check_next_ie;
 			/*check version...*/
 			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));

This is a oddly written function.
Perhaps something like this would be more obvious:

unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)

{
	u8 *pbuf = pie;

	while (1) {
		int len;

		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
		if (!pbuf)
			break;
		/* check if oui matches... */
		if (memcmp(pbuf + 2, WPA_OUI_TYPE, sizeof(WPA_OUI_TYPE)) == 0 &&
		    get_unaligned_le16(pbuf + 6) == 0x0001) {
			*wpa_ie_len = *(pbuf + 1);
			return pbuf;
		}
		limit = limit - (pbuf - pie) - 2 - len;
		if (limit <= 0)
			break;
		pbuf += 2 + len;
	}

	*wpa_ie_len = 0;
	return NULL;
}