linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192e: Fix space and suspect issue
@ 2019-02-28 18:07 Oscar Gomez Fuente
  2019-02-28 20:27 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Oscar Gomez Fuente @ 2019-02-28 18:07 UTC (permalink / raw)
  To: oscargomezf; +Cc: gregkh, devel, linux-kernel

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.

Signed-off-by: Oscar Gomez Fuente <oscargomezf@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index 74d4d2d..4f4904a 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -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];
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: rtl8192e: Fix space and suspect issue
  2019-02-28 18:07 [PATCH] staging: rtl8192e: Fix space and suspect issue Oscar Gomez Fuente
@ 2019-02-28 20:27 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2019-02-28 20:27 UTC (permalink / raw)
  To: Oscar Gomez Fuente; +Cc: gregkh, devel, linux-kernel

On Thu, 2019-02-28 at 19:07 +0100, Oscar Gomez Fuente wrote:
> 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.

> diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
[]
> @@ -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--;
	}



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-28 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 18:07 [PATCH] staging: rtl8192e: Fix space and suspect issue Oscar Gomez Fuente
2019-02-28 20:27 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).