arch, board: squash lines for immediate return
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 6 Sep 2016 13:17:38 +0000 (22:17 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2016 21:53:53 +0000 (17:53 -0400)
Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
Reviewed-by: Angelo Dureghello <angelo@sysam.it>
16 files changed:
arch/arm/cpu/arm920t/imx/timer.c
arch/arm/cpu/armv7/am33xx/sys_info.c
arch/arm/cpu/sa1100/timer.c
arch/arm/mach-zynq/cpu.c
arch/blackfin/cpu/interrupts.c
arch/m68k/lib/time.c
arch/powerpc/cpu/mpc512x/cpu.c
arch/powerpc/cpu/mpc83xx/cpu.c
arch/xtensa/lib/time.c
board/amcc/bamboo/bamboo.c
board/amcc/bubinga/bubinga.c
board/amcc/canyonlands/canyonlands.c
board/corscience/tricorder/tricorder-eeprom.c
board/freescale/common/zm7300.c
board/samsung/goni/goni.c
board/ti/omap5_uevm/evm.c

index b62558f92f47ae7b6a87c43955cd5c027379de15..178422a9bf366e0bf81294481fc7c61ab3f76855 100644 (file)
@@ -78,11 +78,7 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk (void)
 {
-       ulong tbclk;
-
-       tbclk = CONFIG_SYS_HZ;
-
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
 
 /*
index 52a6824cf592187dbb74d66bd8c41c17798f61b2..f42eee166b6c44634089378ee0c64b1ce5488c5c 100644 (file)
@@ -65,9 +65,7 @@ u32 get_device_type(void)
  */
 u32 get_sysboot_value(void)
 {
-       int mode;
-       mode = readl(&cstat->statusreg) & (SYSBOOT_MASK);
-       return mode;
+       return readl(&cstat->statusreg) & SYSBOOT_MASK;
 }
 
 #ifdef CONFIG_DISPLAY_CPUINFO
index 0a0006b426323d4162ea73900137cad3541051c2..90e2128b22ee3ca95d3cc0b169dd9bc7fdd04492 100644 (file)
@@ -66,8 +66,5 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk (void)
 {
-       ulong tbclk;
-
-       tbclk = CONFIG_SYS_HZ;
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
index 914b1feb6833310144d229c307b8130218d00f02..ba9171ebe9f94c1ba455178ccc7030e70d027358 100644 (file)
@@ -43,12 +43,8 @@ int arch_cpu_init(void)
 
 unsigned int zynq_get_silicon_version(void)
 {
-       unsigned int ver;
-
-       ver = (readl(&devcfg_base->mctrl) &
-              ZYNQ_SILICON_VER_MASK) >> ZYNQ_SILICON_VER_SHIFT;
-
-       return ver;
+       return (readl(&devcfg_base->mctrl) & ZYNQ_SILICON_VER_MASK)
+                                               >> ZYNQ_SILICON_VER_SHIFT;
 }
 
 void reset_cpu(ulong addr)
index 45c92c3d3e703a227d53b8c8fde648038c88b211..abb7dc1d1ddfb0693ae5e33b6a01da0b61d161bf 100644 (file)
@@ -47,10 +47,7 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk(void)
 {
-       ulong tbclk;
-
-       tbclk = CONFIG_SYS_HZ;
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
 
 void enable_interrupts(void)
index 31633543e093143bb1dd2ee95d3f96bb2d35b0ae..cb90c83f4e4ab84e2f581df047606e8a4b520b18 100644 (file)
@@ -192,7 +192,5 @@ unsigned long usec2ticks(unsigned long usec)
  */
 ulong get_tbclk(void)
 {
-       ulong tbclk;
-       tbclk = CONFIG_SYS_HZ;
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
index 8508e8db40eeacb4afc636f9398739c6522cf441..4ee91e16f9c689efadf5c82d7760f290a817322c 100644 (file)
@@ -95,11 +95,7 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
  */
 unsigned long get_tbclk (void)
 {
-       ulong tbclk;
-
-       tbclk = (gd->bus_clk + 3L) / 4L;
-
-       return tbclk;
+       return (gd->bus_clk + 3L) / 4L;
 }
 
 
index 38093097e47984b52df44c8fb9e47c4f5b8bb25c..c87f0fdd29f58e0be1b222b13623f3f050c40bdc 100644 (file)
@@ -173,11 +173,7 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
 unsigned long get_tbclk(void)
 {
-       ulong tbclk;
-
-       tbclk = (gd->bus_clk + 3L) / 4L;
-
-       return tbclk;
+       return (gd->bus_clk + 3L) / 4L;
 }
 
 
index 1332072ffe3d01f0761170f1a28e2aa3bdf83996..915eb5185b6c7e75578b42571d7212734c46c2a5 100644 (file)
@@ -104,10 +104,7 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk(void)
 {
-       ulong tbclk;
-
-       tbclk = CONFIG_SYS_HZ;
-       return tbclk;
+       return CONFIG_SYS_HZ;
 }
 
 #if XCHAL_HAVE_CCOUNT
index c8d09636abceba8cf25e1ddc36af3df43423fbd7..2838f9a1edd39ab708c459e15ad020d2ab1b0a49 100644 (file)
@@ -438,11 +438,7 @@ int checkboard(void)
 
 phys_size_t initdram (int board_type)
 {
-       long dram_size;
-
-       dram_size = spd_sdram();
-
-       return dram_size;
+       return spd_sdram();
 }
 
 /*----------------------------------------------------------------------------+
index 5c1e0717a54544e2c133cb79f3e059d901135dc1..9043de62d36d8d7c26b9d471850b629494e44ce6 100644 (file)
@@ -57,8 +57,5 @@ int checkboard(void)
    ------------------------------------------------------------------------- */
 phys_size_t initdram(int board_type)
 {
-       long int ret;
-
-       ret = spd_sdram();
-       return ret;
+       return spd_sdram();
 }
index dc2e3ba3a08d0d7b3b9c73c2791a23fc52370a90..80b77398c467eeccd254b4310a03b3af15ef1ff1 100644 (file)
@@ -63,11 +63,7 @@ u32 ddr_clktr(u32 default_val) {
  */
 static inline int board_fpga_read(int offset)
 {
-       int data;
-
-       data = in_8((void *)(CONFIG_SYS_FPGA_BASE + offset));
-
-       return data;
+       return in_8((void *)(CONFIG_SYS_FPGA_BASE + offset));
 }
 
 static inline void board_fpga_write(int offset, int data)
index 340a009c895af92133c764dd13c6c84a34666260..aeacd6a253a51f2f804bbb5074f00ad2228c4e5c 100644 (file)
@@ -190,13 +190,8 @@ int do_tricorder_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        if (argc == 3) {
                ulong dev_addr = simple_strtoul(argv[2], NULL, 16);
 
-               if (strcmp(argv[1], "read") == 0) {
-                       int rcode;
-
-                       rcode = tricorder_eeprom_read(dev_addr);
-
-                       return rcode;
-               }
+               if (strcmp(argv[1], "read") == 0)
+                       return tricorder_eeprom_read(dev_addr);
        } else if (argc == 6 || argc == 7) {
                ulong dev_addr = simple_strtoul(argv[2], NULL, 16);
                char *name = argv[3];
@@ -207,14 +202,9 @@ int do_tricorder_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                if (argc == 7)
                        interface = argv[6];
 
-               if (strcmp(argv[1], "write") == 0) {
-                       int rcode;
-
-                       rcode = tricorder_eeprom_write(dev_addr, name, version,
-                                       serial, interface);
-
-                       return rcode;
-               }
+               if (strcmp(argv[1], "write") == 0)
+                       return tricorder_eeprom_write(dev_addr, name, version,
+                                                     serial, interface);
        }
 
        return CMD_RET_USAGE;
index be5953ad2d8000f306e0f2fa9c4d6196e48bd266..a6c3e699b811badd629774a55badf9b299b7fe12 100644 (file)
@@ -140,9 +140,7 @@ int dpm_wrp(u8 r, u8 d)
 /* Uses the DPM command RRP */
 u8 zm_read(uchar reg)
 {
-       u8 d;
-       d = dpm_rrp(reg);
-       return d;
+       return dpm_rrp(reg);
 }
 
 /* ZM_write --
index 1600568193ab194ac6e88ea8a8ed26799e5271f6..e8329bba6cbbfbe2b10d97e80373a38dde22918f 100644 (file)
@@ -45,17 +45,11 @@ void i2c_init_board(void)
 
 int power_init_board(void)
 {
-       int ret;
-
        /*
         * For PMIC the I2C bus is named as I2C5, but it is connected
         * to logical I2C adapter 0
         */
-       ret = pmic_init(I2C_0);
-       if (ret)
-               return ret;
-
-       return 0;
+       return pmic_init(I2C_0);
 }
 
 int dram_init(void)
index 50da4109bb8bd4c08f30029ddfa1dabccfcb669f..b5d5ba9bdf9b6aabedada02236a710fd70fa5dc5 100644 (file)
@@ -245,10 +245,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 int ehci_hcd_stop(void)
 {
-       int ret;
-
-       ret = omap_ehci_hcd_stop();
-       return ret;
+       return omap_ehci_hcd_stop();
 }
 
 void usb_hub_reset_devices(int port)