All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: Fix alignment checks with flipped condition
@ 2021-12-18 20:28 Ismayil Mirzali
  2021-12-18 20:58 ` Pavel Skripkin
  0 siblings, 1 reply; 2+ messages in thread
From: Ismayil Mirzali @ 2021-12-18 20:28 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, linux-kernel, linux-staging, simon.fodin, Dan Carpenter

From: Ngo Tak Fong <simon.fodin@gmail.com>

Fixed two CHECKs of Alignment should match open parenthesis and flipped
a condition to pull the code in one tab.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ngo Tak Fong <simon.fodin@gmail.com>
Link: https://lore.kernel.org/r/20211207212223.GA70594@simon-desktop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/rtl8712/rtl8712_efuse.c | 28 ++++++++++++-------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c
index 4f3b54a7c3be..c9400e40a1d6 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.c
+++ b/drivers/staging/rtl8712/rtl8712_efuse.c
@@ -298,25 +298,23 @@ static u8 fix_header(struct _adapter *adapter, u8 header, u16 header_addr)
 			continue;
 		}
 		for (i = 0; i < PGPKG_MAX_WORDS; i++) {
-			if (BIT(i) & word_en) {
-				if (BIT(i) & pkt.word_en) {
-					if (efuse_one_byte_read(
-							adapter, addr,
+			if (!(BIT(i) & word_en))
+				continue;
+			if (BIT(i) & pkt.word_en) {
+				if (efuse_one_byte_read(adapter,
+							addr,
 							&value))
-						pkt.data[i * 2] = value;
-					else
-						return false;
-					if (efuse_one_byte_read(
-							adapter,
+					pkt.data[i * 2] = value;
+				else
+					return false;
+				if (efuse_one_byte_read(adapter,
 							addr + 1,
 							&value))
-						pkt.data[i * 2 + 1] =
-							value;
-					else
-						return false;
-				}
-				addr += 2;
+					pkt.data[i * 2 + 1] = value;
+				else
+					return false;
 			}
+			addr += 2;
 		}
 	}
 	if (addr != header_addr)
-- 
2.25.1


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

* Re: [PATCH] staging: rtl8712: Fix alignment checks with flipped condition
  2021-12-18 20:28 [PATCH] staging: rtl8712: Fix alignment checks with flipped condition Ismayil Mirzali
@ 2021-12-18 20:58 ` Pavel Skripkin
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Skripkin @ 2021-12-18 20:58 UTC (permalink / raw)
  To: Ismayil Mirzali, gregkh
  Cc: Larry.Finger, linux-kernel, linux-staging, simon.fodin, Dan Carpenter

On 12/18/21 23:28, Ismayil Mirzali wrote:
> From: Ngo Tak Fong <simon.fodin@gmail.com>
> 
> Fixed two CHECKs of Alignment should match open parenthesis and flipped
> a condition to pull the code in one tab.
> 
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Ngo Tak Fong <simon.fodin@gmail.com>
> Link: https://lore.kernel.org/r/20211207212223.GA70594@simon-desktop
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---

This one is already applied to staging-testing.
See commit d0df53d36cd51154463796bc6abdd11abdbc67c1

Looks like you have sent it by accident



With regards,
Pavel Skripkin

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

end of thread, other threads:[~2021-12-18 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-18 20:28 [PATCH] staging: rtl8712: Fix alignment checks with flipped condition Ismayil Mirzali
2021-12-18 20:58 ` Pavel Skripkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.