Skip to contentSkip to conversation

staging: rtl8192e: Fix space and suspect issue

PATCH In review Oscar Gomez Fuente 2 participants 2 messages Feb 28, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192e: Fix space and suspect issue

These changes fixed a checkpatch error for space required before the open brace '{' as well as a warning for suspect code indent for conditional statements.

---
 drivers/staging/rtl8192e/rtllib_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/rtllib_wx.c +2 -2
index 74d4d2d..4f4904a 100644
@@ -541,8 +541,8 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
 		if (idx < 1 || idx > NUM_WEP_KEYS)
 			return -EINVAL;
 		idx--;
-	} else{
-			idx = ieee->crypt_info.tx_keyidx;
+	} else {
+		idx = ieee->crypt_info.tx_keyidx;
 	}
 	if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
 		crypt = &ieee->crypt_info.crypt[idx];
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Oscar Gomez Fuente

These changes fixed a checkpatch error for space required before the open brace '{' as well as a warning for suspect code indent for conditional statements.

Simple enough, thanks.

drivers/staging/rtl8192e/rtllib_wx.c

Quoted 1 line
drivers/staging/rtl8192e/rtllib_wx.c +0 -0

[]

drivers/staging/rtl8192e/rtllib_wx.c int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, · line 541

Quoted 2 lines
drivers/staging/rtl8192e/rtllib_wx.c +0 -0
@@ -541,8 +541,8 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
 		if (idx < 1 || idx > NUM_WEP_KEYS)

trivia:

the idx < 1 here test is superfluous as idx
is an int masked with 0xff and can't be < 1
if also non-zero

Original code:

	idx = encoding->flags & IW_ENCODE_INDEX;
	if (idx) {
		if (idx < 1 || idx > NUM_WEP_KEYS)
			return -EINVAL;
		idx--;
	}