Skip to contentSkip to conversation

staging: rtl8723bs: replace while with shorter for loop

PATCH In review Michael Straube 2 participants 11 messages Jul 8, 2018 – Jul 11, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 staging: rtl8723bs: replace while with shorter for loop

Simplify rtw_get_rateset_len() by replacing the while loop with a shorter for loop.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +3 -9
index 8e0025e1ff14..9b60e0214bd8 100644
@@ -298,17 +298,11 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 
 uint	rtw_get_rateset_len(u8 *rateset)
 {
-	uint i = 0;
+	uint i;
 
-	while (1) {
-		if ((rateset[i]) == 0)
-			break;
-
-		if (i > 12)
+	for (i = 0; i < 13; i++)
+		if (rateset[i] == 0)
 			break;
-
-		i++;
-	}
 	return i;
 }
 
Signature · 1 line
2.18.0
#1 lore raw

PATCH 2/6 staging: rtl8723bs: replace tab with space

Replace tabs with spaces in some function definitions.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +3 -3
index 9b60e0214bd8..429ec929fa1a 100644
@@ -67,7 +67,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
 	return 0;
 }
 
-uint	rtw_is_cckrates_included(u8 *rate)
+uint rtw_is_cckrates_included(u8 *rate)
 {
 		u32 i = 0;
 
@@ -81,7 +81,7 @@ uint	rtw_is_cckrates_included(u8 *rate)
 		return false;
 }
 
-uint	rtw_is_cckratesonly_included(u8 *rate)
+uint rtw_is_cckratesonly_included(u8 *rate)
 {
 	u32 i = 0;
 
@@ -296,7 +296,7 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 	}
 }
 
-uint	rtw_get_rateset_len(u8 *rateset)
+uint rtw_get_rateset_len(u8 *rateset)
 {
 	uint i;
 
Signature · 1 line
2.18.0
#2 lore raw

PATCH 3/6 staging: rtl8723bs: fix indentation

In reply to Michael Straube

Remove unrequired extra indentations.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +8 -8
index 429ec929fa1a..adf216de113b 100644
@@ -69,16 +69,16 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
 
 uint rtw_is_cckrates_included(u8 *rate)
 {
-		u32 i = 0;
+	u32 i = 0;
 
-		while (rate[i] !=  0) {
-			if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
-			     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
-				return true;
-			i++;
-		}
+	while (rate[i] !=  0) {
+		if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
+		     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
+			return true;
+		i++;
+	}
 
-		return false;
+	return false;
 }
 
 uint rtw_is_cckratesonly_included(u8 *rate)
Signature · 1 line
2.18.0
#3 lore raw

Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

Quoted 1 line · Michael Straube

Remove unrequired extra indentations.

[]

drivers/staging/rtl8723bs/core/rtw_ieee80211.c

Quoted 1 line
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +0 -0

[]

Quoted 13 lines
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -7
@@ -69,16 +69,16 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
 
 uint rtw_is_cckrates_included(u8 *rate)
 {
-		u32 i = 0;
+	u32 i = 0;
 
-		while (rate[i] !=  0) {
-			if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
-			     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
-				return true;
-			i++;
-		}

drivers/staging/rtl8723bs/core/rtw_ieee80211.c int rtw_get_bit_value_from_ieee_value(u8 val) · line 82

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +7 -1
+	while (rate[i] !=  0) {
+		if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
+		     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
+			return true;
+		i++;
+	}
 
-		return false;
+	return false;
 }

Hi Michael.

Please try to improve the code for human readers and/or reduce overall object size over merely shutting up checkpatch style warnings.

For instance:

You could reduce object size a little by eliminating the multiple use of 0x7f and index and dereferencing the pointer instead.

$ size drivers/staging/rtl8723bs/core/rtw_ieee80211.o*
   text	   data	    bss	    dec	    hex	filename
  10085	     76	      0	  10161	   27b1	drivers/staging/rtl8723bs/core/rtw_ieee80211.o.new
  10149	     76	      0	  10225	   27f1	drivers/staging/rtl8723bs/core/rtw_ieee80211.o.old

Something like:

uint rtw_is_cckrates_included(u8 *rate)

{
	while (*rate) {
		u8 r = *rate & 0x7f;

		if (r == 2 || r == 4 || r == 11 || r == 22)
			return true;
		rate++;
	}

	return false;
}

uint rtw_is_cckratesonly_included(u8 *rate)

{
	while (*rate) {
		u8 r = *rate & 0x7f;

		if (r != 2 && r != 4 && r != 11 && r != 22)
			return false;
		rate++;
	}

	return true;
}
#4 lore raw

Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

Quoted 31 lines · Joe Perches
Quoted 1 line · Michael Straube

Remove unrequired extra indentations.

[]

drivers/staging/rtl8723bs/core/rtw_ieee80211.c

Quoted 1 line
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +0 -0

[]

Quoted 13 lines
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -7
@@ -69,16 +69,16 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
 
  uint rtw_is_cckrates_included(u8 *rate)
  {
-		u32 i = 0;
+	u32 i = 0;
 
-		while (rate[i] !=  0) {
-			if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
-			     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
-				return true;
-			i++;
-		}

drivers/staging/rtl8723bs/core/rtw_ieee80211.c int rtw_get_bit_value_from_ieee_value(u8 val) · line 82

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +7 -1
+	while (rate[i] !=  0) {
+		if  ((((rate[i]) & 0x7f) == 2)	|| (((rate[i]) & 0x7f) == 4) ||
+		     (((rate[i]) & 0x7f) == 11)  || (((rate[i]) & 0x7f) == 22))
+			return true;
+		i++;
+	}
 
-		return false;
+	return false;
  }

Hi Michael.

Quoted 4 lines

Please try to improve the code for human readers and/or reduce overall object size over merely shutting up checkpatch style warnings.

Hi Joe,

I agree that it's better to improve the code than just silence warnings.

Thanks for your advice.

Quoted 27 lines

For instance:

You could reduce object size a little by eliminating the multiple use of 0x7f and index and dereferencing the pointer instead.

$ size drivers/staging/rtl8723bs/core/rtw_ieee80211.o*
    text	   data	    bss	    dec	    hex	filename
   10085	     76	      0	  10161	   27b1	drivers/staging/rtl8723bs/core/rtw_ieee80211.o.new
   10149	     76	      0	  10225	   27f1	drivers/staging/rtl8723bs/core/rtw_ieee80211.o.old

Something like:

uint rtw_is_cckrates_included(u8 *rate)

{
	while (*rate) {
		u8 r = *rate & 0x7f;

		if (r == 2 || r == 4 || r == 11 || r == 22)
			return true;
		rate++;
	}

	return false;
}

uint rtw_is_cckratesonly_included(u8 *rate)

Quoted 12 lines
{
	while (*rate) {
		u8 r = *rate & 0x7f;

		if (r != 2 && r != 4 && r != 11 && r != 22)
			return false;
		rate++;
	}

	return true;
}

The patch has been added to staging-testing already. I will send patches with your suggestions the next days.

Thanks again.

Michael

#5 lore raw

Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

Quoted 13 lines · Michael Straube
Quoted 12 lines · Joe Perches

On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:

uint rtw_is_cckratesonly_included(u8 *rate)
{
    while (*rate) {
        u8 r = *rate & 0x7f;

        if (r != 2 && r != 4 && r != 11 && r != 22) return false;
        rate++;
    }

Quoted 6 lines
Quoted 3 lines

    return true;
}

The patch has been added to staging-testing already. I will send patches with your suggestions the next days.

Would it be preferred to declare the variable at the functions beginning, or doesn't it matter regarding coding style?

uint rtw_is_cckratesonly_included(u8 *rate)

{
        u8 r;

        while (*rate) {
                r = *rate & 0x7f;
        ...

Best,
Michael

#6 lore raw

Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

Quoted 18 lines · Michael Straube
Quoted 17 lines · Michael Straube
Quoted 15 lines · Joe Perches

On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:

uint rtw_is_cckratesonly_included(u8 *rate)

{
    while (*rate) {
        u8 r = *rate & 0x7f;

        if (r != 2 && r != 4 && r != 11 && r != 22)
            return false;
        rate++;
    }

    return true;
}
Quoted 5 lines
Quoted 2 lines

The patch has been added to staging-testing already. I will send patches with your suggestions the next days.

Would it be preferred to declare the variable at the functions beginning, or doesn't it matter regarding coding style?

Not really.

It's generally preferred to have declarations in the nearest possible open brace to allow the compiler to reduce the overall stack space consumed by the function.

For example prefer:

int some_function(int arg, void *pointer)

{
	if (arg == 1} {
		struct foo a = *(struct foo *)pointer;
		...
	} else if (arg == 2) {
		struct bar b = *(struct bar *)pointer;
		...
	}
}

over

int some_function(int arg, void *pointer)

{
	struct foo a;
	s

truct bar b;

	if (arg == 1} {
		a = *(struct foo *)pointer;
		...
	} else if (arg == 2) {
		b = *(struct bar *)pointer;
		...
	}
}

as a and b could use the same stack in the first example but not the second.

#7 lore raw

Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

Quoted 61 lines · Joe Perches
Quoted 18 lines · Michael Straube
Quoted 17 lines · Michael Straube
Quoted 15 lines · Joe Perches

On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:

uint rtw_is_cckratesonly_included(u8 *rate)

{
     while (*rate) {
         u8 r = *rate & 0x7f;

         if (r != 2 && r != 4 && r != 11 && r != 22)
             return false;
         rate++;
     }

     return true;
}
Quoted 5 lines
Quoted 2 lines

The patch has been added to staging-testing already. I will send patches with your suggestions the next days.

Would it be preferred to declare the variable at the functions beginning, or doesn't it matter regarding coding style?

Not really.

It's generally preferred to have declarations in the nearest possible open brace to allow the compiler to reduce the overall stack space consumed by the function.

For example prefer:

int some_function(int arg, void *pointer)

{
	if (arg == 1} {
		struct foo a = *(struct foo *)pointer;
		...
	} else if (arg == 2) {
		struct bar b = *(struct bar *)pointer;
		...
	}
}

over

int some_function(int arg, void *pointer)

{
	struct foo a;
	s

truct bar b;

	if (arg == 1} {
		a = *(struct foo *)pointer;
		...
	} else if (arg == 2) {
		b = *(struct bar *)pointer;
		...
	}
}
Quoted 3 lines

as a and b could use the same stack in the first example but not the second.

Ok, thanks for explaining.
Michael

#8 lore raw

PATCH 4/6 staging: rtl8723bs: remove blank lines

In reply to Michael Straube

Remove unrequired blank lines as reported by checkpatch.

---
 .../staging/rtl8723bs/core/rtw_ieee80211.c    | 31 -------------------
 1 file changed, 31 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +0 -31
index adf216de113b..ab1174f7c83a 100644
@@ -53,11 +53,9 @@ static u8 WIFI_OFDMRATES[] = {
 		IEEE80211_OFDM_RATE_54MB
 };
 
-
 int rtw_get_bit_value_from_ieee_value(u8 val)
 {
 	unsigned char dot11_rate_table[] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; /*  last element must be zero!! */
-
 	int i = 0;
 	while (dot11_rate_table[i] != 0) {
 		if (dot11_rate_table[i] == val)
@@ -85,7 +83,6 @@ uint rtw_is_cckratesonly_included(u8 *rate)
 {
 	u32 i = 0;
 
-
 	while (rate[i] != 0) {
 		if  ((((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
 		     (((rate[i]) & 0x7f) != 11)  && (((rate[i]) & 0x7f) != 22))
@@ -111,7 +108,6 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
 		else
 			return WIRELESS_11G;
 	}
-
 }
 
 u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
@@ -191,7 +187,6 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
 	uint cnt;
 	u8 *target_ie = NULL;
 
-
 	if (ielen)
 		*ielen = 0;
 
@@ -215,7 +210,6 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
 		} else{
 			cnt += in_ie[cnt+1]+2; /* goto next */
 		}
-
 	}
 
 	return target_ie;
@@ -292,7 +286,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 		memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
 		memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
 		break;
-
 	}
 }
 
@@ -363,7 +356,6 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
 	/* DS parameter set */
 	ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz);
 
-
 	/* IBSS Parameter Set */
 
 	ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
@@ -398,10 +390,8 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 		pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
 
 		if (pbuf) {
-
 			/* check if oui matches... */
 			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type))) {
-
 				goto check_next_ie;
 			}
 
@@ -417,7 +407,6 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 			return pbuf;
 
 		} else{
-
 			*wpa_ie_len = 0;
 			return NULL;
 		}
@@ -430,20 +419,16 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 			break;
 
 		pbuf += (2 + len);
-
 	}
 
 	*wpa_ie_len = 0;
 
 	return NULL;
-
 }
 
 unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
 {
-
 	return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit);
-
 }
 
 int rtw_get_wpa_cipher_suite(u8 *s)
@@ -478,7 +463,6 @@ int rtw_get_wpa2_cipher_suite(u8 *s)
 	return 0;
 }
 
-
 int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
 {
 	int i, ret = _SUCCESS;
@@ -491,7 +475,6 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
 		return _FAIL;
 	}
 
-
 	if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
 	   (memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) {
 		return _FAIL;
@@ -502,10 +485,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
 	pos += 8;
 	left = wpa_ie_len - 8;
 
-
 	/* group_cipher */
 	if (left >= WPA_SELECTOR_LEN) {
-
 		*group_cipher = rtw_get_wpa_cipher_suite(pos);
 
 		pos += WPA_SELECTOR_LEN;
@@ -517,7 +498,6 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
 		return _FAIL;
 	}
 
-
 	/* pairwise_cipher */
 	if (left >= 2) {
 		/* count = le16_to_cpu(*(u16*)pos); */
@@ -554,7 +534,6 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
 	}
 
 	return ret;
-
 }
 
 int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
@@ -569,7 +548,6 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
 		return _FAIL;
 	}
 
-
 	if ((*rsn_ie != _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) {
 		return _FAIL;
 	}
@@ -580,7 +558,6 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
 
 	/* group_cipher */
 	if (left >= RSN_SELECTOR_LEN) {
-
 		*group_cipher = rtw_get_wpa2_cipher_suite(pos);
 
 		pos += RSN_SELECTOR_LEN;
@@ -628,7 +605,6 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
 	}
 
 	return ret;
-
 }
 
 /* ifdef CONFIG_WAPI_SUPPORT */
@@ -730,7 +706,6 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
 				cnt += in_ie[cnt+1]+2;   /* get next */
 			}
 		}
-
 	}
 
 	return (*rsn_len + *wpa_len);
@@ -795,7 +770,6 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
 		} else{
 			cnt += in_ie[cnt+1]+2; /* goto next */
 		}
-
 	}
 
 	return wpsie_ptr;
@@ -848,7 +822,6 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att
 		} else{
 			attr_ptr += attr_len; /* goto next */
 		}
-
 	}
 
 	return target_attr_ptr;
@@ -981,7 +954,6 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
 	}
 
 	return 0;
-
 }
 
 /**
@@ -1128,7 +1100,6 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
 		return ParseFailed;
 
 	return unknown ? ParseUnknown : ParseOK;
-
 }
 
 void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
@@ -1173,7 +1144,6 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
 	if (pbuf && (wpa_ielen > 0)) {
 		RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen));
 		if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
-
 			pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
 			pnetwork->BcnInfo.group_cipher = group_cipher;
 			pnetwork->BcnInfo.is_8021x = is8021x;
@@ -1182,7 +1152,6 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
 			ret = _SUCCESS;
 		}
 	} else {
-
 		pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
 
 		if (pbuf && (wpa_ielen > 0)) {
Signature · 1 line
2.18.0
#9 lore raw

PATCH 5/6 staging: rtl8723bs: add missing blank lines

In reply to Michael Straube

Add missing blank lines after declarations as reported by checkpatch.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +2 -0
index ab1174f7c83a..a4f9e2b90b08 100644
@@ -57,6 +57,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
 {
 	unsigned char dot11_rate_table[] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; /*  last element must be zero!! */
 	int i = 0;
+
 	while (dot11_rate_table[i] != 0) {
 		if (dot11_rate_table[i] == val)
 			return BIT(i);
@@ -1139,6 +1140,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
 	unsigned char *pbuf;
 	int group_cipher = 0, pairwise_cipher = 0, is8021x = 0;
 	int ret = _FAIL;
+
 	pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
 
 	if (pbuf && (wpa_ielen > 0)) {
Signature · 1 line
2.18.0
#10 lore raw

PATCH 6/6 staging: rtl8723bs: remove braces from single if statement

In reply to Michael Straube

Remove braces from single if statement to follow kernel coding style.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -2
index a4f9e2b90b08..3f1c7bb0eb9f 100644
@@ -149,9 +149,8 @@ u8 *rtw_get_ie(u8 *pbuf, sint index, sint *len, sint limit)
 	sint tmp, i;
 	u8 *p;
 
-	if (limit < 1) {
+	if (limit < 1)
 		return NULL;
-	}
 
 	p = pbuf;
 	i = 0;
Signature · 1 line
2.18.0