All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 7/8] arch, board: squash lines for immediate return
Date: Tue,  6 Sep 2016 22:17:38 +0900	[thread overview]
Message-ID: <1473167860-27465-8-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com>

Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v3:
  - More fixes

 arch/arm/cpu/arm920t/imx/timer.c              |  6 +-----
 arch/arm/cpu/armv7/am33xx/sys_info.c          |  4 +---
 arch/arm/cpu/sa1100/timer.c                   |  5 +----
 arch/arm/mach-zynq/cpu.c                      |  8 ++------
 arch/blackfin/cpu/interrupts.c                |  5 +----
 arch/m68k/lib/time.c                          |  4 +---
 arch/powerpc/cpu/mpc512x/cpu.c                |  6 +-----
 arch/powerpc/cpu/mpc83xx/cpu.c                |  6 +-----
 arch/xtensa/lib/time.c                        |  5 +----
 board/amcc/bamboo/bamboo.c                    |  6 +-----
 board/amcc/bubinga/bubinga.c                  |  5 +----
 board/amcc/canyonlands/canyonlands.c          |  6 +-----
 board/corscience/tricorder/tricorder-eeprom.c | 20 +++++---------------
 board/freescale/common/zm7300.c               |  4 +---
 board/samsung/goni/goni.c                     |  8 +-------
 board/ti/omap5_uevm/evm.c                     |  5 +----
 16 files changed, 21 insertions(+), 82 deletions(-)

diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index b62558f..178422a 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -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;
 }
 
 /*
diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c b/arch/arm/cpu/armv7/am33xx/sys_info.c
index 52a6824..f42eee1 100644
--- a/arch/arm/cpu/armv7/am33xx/sys_info.c
+++ b/arch/arm/cpu/armv7/am33xx/sys_info.c
@@ -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
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index 0a0006b..90e2128 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -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;
 }
diff --git a/arch/arm/mach-zynq/cpu.c b/arch/arm/mach-zynq/cpu.c
index 914b1fe..ba9171e 100644
--- a/arch/arm/mach-zynq/cpu.c
+++ b/arch/arm/mach-zynq/cpu.c
@@ -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)
diff --git a/arch/blackfin/cpu/interrupts.c b/arch/blackfin/cpu/interrupts.c
index 45c92c3..abb7dc1 100644
--- a/arch/blackfin/cpu/interrupts.c
+++ b/arch/blackfin/cpu/interrupts.c
@@ -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)
diff --git a/arch/m68k/lib/time.c b/arch/m68k/lib/time.c
index 3163354..cb90c83 100644
--- a/arch/m68k/lib/time.c
+++ b/arch/m68k/lib/time.c
@@ -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;
 }
diff --git a/arch/powerpc/cpu/mpc512x/cpu.c b/arch/powerpc/cpu/mpc512x/cpu.c
index 8508e8d..4ee91e1 100644
--- a/arch/powerpc/cpu/mpc512x/cpu.c
+++ b/arch/powerpc/cpu/mpc512x/cpu.c
@@ -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;
 }
 
 
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 3809309..c87f0fd 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -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;
 }
 
 
diff --git a/arch/xtensa/lib/time.c b/arch/xtensa/lib/time.c
index 1332072..915eb51 100644
--- a/arch/xtensa/lib/time.c
+++ b/arch/xtensa/lib/time.c
@@ -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
diff --git a/board/amcc/bamboo/bamboo.c b/board/amcc/bamboo/bamboo.c
index c8d0963..2838f9a 100644
--- a/board/amcc/bamboo/bamboo.c
+++ b/board/amcc/bamboo/bamboo.c
@@ -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();
 }
 
 /*----------------------------------------------------------------------------+
diff --git a/board/amcc/bubinga/bubinga.c b/board/amcc/bubinga/bubinga.c
index 5c1e071..9043de6 100644
--- a/board/amcc/bubinga/bubinga.c
+++ b/board/amcc/bubinga/bubinga.c
@@ -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();
 }
diff --git a/board/amcc/canyonlands/canyonlands.c b/board/amcc/canyonlands/canyonlands.c
index dc2e3ba..80b7739 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -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)
diff --git a/board/corscience/tricorder/tricorder-eeprom.c b/board/corscience/tricorder/tricorder-eeprom.c
index 340a009..aeacd6a 100644
--- a/board/corscience/tricorder/tricorder-eeprom.c
+++ b/board/corscience/tricorder/tricorder-eeprom.c
@@ -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;
diff --git a/board/freescale/common/zm7300.c b/board/freescale/common/zm7300.c
index be5953a..a6c3e69 100644
--- a/board/freescale/common/zm7300.c
+++ b/board/freescale/common/zm7300.c
@@ -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 --
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 1600568..e8329bb 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -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)
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 50da410..b5d5ba9 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -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)
-- 
1.9.1

  parent reply	other threads:[~2016-09-06 13:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 13:17 [U-Boot] [PATCH v3 0/8] Clean-up: squash lines for immediate return Masahiro Yamada
2016-09-06 13:17 ` [U-Boot] [PATCH v3 1/8] mmc: " Masahiro Yamada
2016-09-08 13:46   ` Jaehoon Chung
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 2/8] video: " Masahiro Yamada
2016-09-06 14:23   ` Simon Glass
2016-09-06 17:25   ` Stephen Warren
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 3/8] usb: replace ehci_*_remove() with usb_deregister() Masahiro Yamada
2016-09-06 17:27   ` Stephen Warren
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 4/8] usb: squash lines for immediate return Masahiro Yamada
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 5/8] x86: " Masahiro Yamada
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 6/8] libfdt: simplify fdt_del_mem_rsv() Masahiro Yamada
2016-09-06 14:23   ` Simon Glass
2016-09-24  2:28   ` [U-Boot] [U-Boot,v3,6/8] " Tom Rini
2016-09-06 13:17 ` Masahiro Yamada [this message]
2016-09-06 16:37   ` [U-Boot] [PATCH v3 7/8] arch, board: squash lines for immediate return Minkyu Kang
2016-09-08 21:26   ` Angelo Dureghello
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 8/8] drivers: " Masahiro Yamada
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473167860-27465-8-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.