staging: rtl8712: Fix alignment checks with flipped condition
authorNgo Tak Fong <simon.fodin@gmail.com>
Tue, 7 Dec 2021 21:22:23 +0000 (05:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Dec 2021 07:57:22 +0000 (08:57 +0100)
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

index 4f3b54a..c9400e4 100644 (file)
@@ -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)