]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
mtd: xilinx_nandps: Clean coding style issue
authorMichal Simek <michal.simek@xilinx.com>
Wed, 28 Nov 2012 16:13:17 +0000 (17:13 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 29 Nov 2012 07:36:56 +0000 (08:36 +0100)
Split testing cases from not good looking if else structures.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: John Linn <john.linn@xilinx.com>
drivers/mtd/nand/xilinx_nandps.c

index d1fa45371a416818d215cd9a0b1c77e0cda0b5fd..5f8250a75464add055bfd4459400af4ebba4e3e9 100644 (file)
@@ -382,11 +382,12 @@ int xnandps_correct_data(struct mtd_info *mtd, unsigned char *buf,
                /* Toggling error bit */
                buf[byte_addr] ^= (1 << bit_addr);
                return 1;
-       } else if (onehot(ecc_odd | ecc_even) == 1) {
-               return 1; /* one error in parity */
-       } else {
-               return -1; /* Uncorrectable error */
        }
+
+       if (onehot(ecc_odd | ecc_even) == 1)
+               return 1; /* one error in parity */
+
+       return -1; /* Uncorrectable error */
 }
 
 /**