ARM: i.MX: system.c: Convert goto to if statement
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Sun, 19 Jun 2016 01:09:27 +0000 (18:09 -0700)
committerShawn Guo <shawnguo@kernel.org>
Tue, 21 Jun 2016 12:39:25 +0000 (20:39 +0800)
Using goto here doesn't bring any advantages and only makes the code
flow less clear. No functional changes.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/system.c

index 105d1ce4ed9d1400da09d476c03761e2de5c982e..d9f8b0e1d96a581c027234243d5bd16743f4868c 100644 (file)
@@ -106,26 +106,24 @@ void __init imx_init_l2cache(void)
                goto out;
        }
 
-       if (readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)
-               goto skip_if_enabled;
-
-       /* Configure the L2 PREFETCH and POWER registers */
-       val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL);
-       val |= 0x70800000;
-       /*
-        * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
-        * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
-        * But according to ARM PL310 errata: 752271
-        * ID: 752271: Double linefill feature can cause data corruption
-        * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
-        * Workaround: The only workaround to this erratum is to disable the
-        * double linefill feature. This is the default behavior.
-        */
-       if (cpu_is_imx6q())
-               val &= ~(1 << 30 | 1 << 23);
-       writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL);
+       if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
+               /* Configure the L2 PREFETCH and POWER registers */
+               val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL);
+               val |= 0x70800000;
+               /*
+                * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
+                * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
+                * But according to ARM PL310 errata: 752271
+                * ID: 752271: Double linefill feature can cause data corruption
+                * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
+                * Workaround: The only workaround to this erratum is to disable the
+                * double linefill feature. This is the default behavior.
+                */
+               if (cpu_is_imx6q())
+                       val &= ~(1 << 30 | 1 << 23);
+               writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL);
+       }
 
-skip_if_enabled:
        iounmap(l2x0_base);
        of_node_put(np);