Skip to contentSkip to conversation

Clean-up: squash lines for immediate return

PATCH New Masahiro Yamada 7 participants 24 messages Sep 6, 2016 – Sep 24, 2016

Subsystems (21)
lore
Share & tools
lore
#0 lore raw

v3 cover Clean-up: squash lines for immediate return

ret = [expression];
if (ret)

        return ret;

return 0;

... is equivalent to:

return [expression];

First, I sent a tree-wide patch:
http://patchwork.ozlabs.org/patch/665199/

In the review of v1, Stephen suggested that twee-wide conversion with something like Coccinelle can break code uniformity.
I took a closer look once again, I found many hunks we should not change.

So, here is an updated series.

I limited this refactoring to cases, I think, really beneficial.
(Mostly, they well be simple wrappers with this series.)

I also split patches per-subsystem
for easier review and Acked-by
(or NACK if reviewers found no good reason to change).

Masahiro Yamada (8):
mmc: squash lines for immediate return
video: squash lines for immediate return
usb: replace ehci_*_remove() with usb_deregister()
usb: squash lines for immediate return
x86: squash lines for immediate return
libfdt: simplify fdt_del_mem_rsv() arch,board: squash lines for immediate return
drivers: squash lines for immediate return

 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/x86/cpu/baytrail/valleyview.c            |  8 +-------
 arch/x86/cpu/ivybridge/ivybridge.c            |  8 +-------
 arch/x86/cpu/qemu/qemu.c                      |  8 +-------
 arch/x86/cpu/queensbay/tnc.c                  |  8 +-------
 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 +----
 common/usb.c                                  | 20 +++++++------------
 common/usb_kbd.c                              |  5 +----
 common/usb_storage.c                          |  9 +++------
 drivers/block/sym53c8xx.c                     |  5 ++---
 drivers/ddr/fsl/ddr1_dimm_params.c            | 12 ++----------
 drivers/ddr/fsl/ddr2_dimm_params.c            | 12 ++----------
 drivers/ddr/marvell/a38x/ddr3_a38x.c          |  6 +-----
 drivers/mmc/atmel_sdhci.c                     |  7 +------
 drivers/mmc/exynos_dw_mmc.c                   |  7 +------
 drivers/mmc/mmc_boot.c                        | 28 ++++++++-------------------
 drivers/mmc/msm_sdhci.c                       |  7 +------
 drivers/mmc/rockchip_dw_mmc.c                 |  7 +------
 drivers/mmc/rockchip_sdhci.c                  |  7 +------
 drivers/mmc/sandbox_mmc.c                     |  7 +------
 drivers/mmc/zynq_sdhci.c                      |  7 +------
 drivers/power/axp809.c                        |  8 +-------
 drivers/rtc/m48t35ax.c                        |  4 +---
 drivers/usb/host/ehci-atmel.c                 | 13 +------------
 drivers/usb/host/ehci-fsl.c                   | 13 +------------
 drivers/usb/host/ehci-generic.c               |  7 +------
 drivers/usb/host/ehci-marvell.c               | 13 +------------
 drivers/usb/host/ehci-mx6.c                   | 13 +------------
 drivers/usb/host/ehci-pci.c                   | 13 +------------
 drivers/usb/host/ehci-tegra.c                 | 13 +------------
 drivers/usb/host/ehci-zynq.c                  | 13 +------------
 drivers/usb/host/xhci-fsl.c                   |  7 +------
 drivers/video/bridge/ptn3460.c                |  7 +------
 drivers/video/broadwell_igd.c                 |  5 +----
 drivers/video/exynos/exynos_dp_lowlevel.c     |  6 +-----
 drivers/video/tegra124/display.c              |  8 +-------
 drivers/video/vidconsole-uclass.c             |  6 +-----
 lib/libfdt/fdt_rw.c                           |  6 +-----
 52 files changed, 75 insertions(+), 361 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/8 mmc: squash lines for immediate return

These functions can be much simpler by squashing lines for immediate return.

For *_bind() callbacks, they will be a simple wrapper function of an upper-level bind API.

For mmc_set_{boot_bus_width,part_conf}, they will be a wrapper of mmc_switch().

---

Changes in v3: None

 drivers/mmc/atmel_sdhci.c     |  7 +------
 drivers/mmc/exynos_dw_mmc.c   |  7 +------
 drivers/mmc/mmc_boot.c        | 28 ++++++++--------------------
 drivers/mmc/msm_sdhci.c       |  7 +------
 drivers/mmc/rockchip_dw_mmc.c |  7 +------
 drivers/mmc/rockchip_sdhci.c  |  7 +------
 drivers/mmc/sandbox_mmc.c     |  7 +------
 drivers/mmc/zynq_sdhci.c      |  7 +------
 8 files changed, 15 insertions(+), 62 deletions(-)
drivers/mmc/atmel_sdhci.c +1 -6
index dd6bd33..d8f8087 100644
@@ -136,13 +136,8 @@ static int atmel_sdhci_probe(struct udevice *dev)
 static int atmel_sdhci_bind(struct udevice *dev)
 {
 	struct atmel_sdhci_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id atmel_sdhci_ids[] = {
drivers/mmc/exynos_dw_mmc.c +1 -6
index 57271f1..568fed7 100644
@@ -284,13 +284,8 @@ static int exynos_dwmmc_probe(struct udevice *dev)
 static int exynos_dwmmc_bind(struct udevice *dev)
 {
 	struct exynos_mmc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = dwmci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dwmci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id exynos_dwmmc_ids[] = {
drivers/mmc/mmc_boot.c +8 -20
index 756a982..ac6f56f 100644
@@ -85,16 +85,10 @@ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
  */
 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
 {
-	int err;
-
-	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
-			 EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
-			 EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
-			 EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
-
-	if (err)
-		return err;
-	return 0;
+	return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
+			  EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
+			  EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
+			  EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
 }
 
 /*
@@ -106,16 +100,10 @@ int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
  */
 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
 {
-	int err;
-
-	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
-			 EXT_CSD_BOOT_ACK(ack) |
-			 EXT_CSD_BOOT_PART_NUM(part_num) |
-			 EXT_CSD_PARTITION_ACCESS(access));
-
-	if (err)
-		return err;
-	return 0;
+	return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
+			  EXT_CSD_BOOT_ACK(ack) |
+			  EXT_CSD_BOOT_PART_NUM(part_num) |
+			  EXT_CSD_PARTITION_ACCESS(access));
 }
 
 /*
drivers/mmc/msm_sdhci.c +1 -6
index 8d4399e..1b82991 100644
@@ -190,13 +190,8 @@ static int msm_ofdata_to_platdata(struct udevice *dev)
 static int msm_sdc_bind(struct udevice *dev)
 {
 	struct msm_sdhc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id msm_mmc_ids[] = {
drivers/mmc/rockchip_dw_mmc.c +1 -6
index 020a59b..859760b 100644
@@ -142,13 +142,8 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 static int rockchip_dwmmc_bind(struct udevice *dev)
 {
 	struct rockchip_mmc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = dwmci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dwmci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id rockchip_dwmmc_ids[] = {
drivers/mmc/rockchip_sdhci.c +1 -6
index 624029b..c56e1a3 100644
@@ -62,13 +62,8 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 static int rockchip_sdhci_bind(struct udevice *dev)
 {
 	struct rockchip_sdhc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id arasan_sdhci_ids[] = {
drivers/mmc/sandbox_mmc.c +1 -6
index 5f1333b..fdb29a5 100644
@@ -112,7 +112,6 @@ int sandbox_mmc_bind(struct udevice *dev)
 {
 	struct sandbox_mmc_plat *plat = dev_get_platdata(dev);
 	struct mmc_config *cfg = &plat->cfg;
-	int ret;
 
 	cfg->name = dev->name;
 	cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT;
@@ -121,11 +120,7 @@ int sandbox_mmc_bind(struct udevice *dev)
 	cfg->f_max = 52000000;
 	cfg->b_max = U32_MAX;
 
-	ret = mmc_bind(dev, &plat->mmc, cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mmc_bind(dev, &plat->mmc, cfg);
 }
 
 int sandbox_mmc_unbind(struct udevice *dev)
drivers/mmc/zynq_sdhci.c +1 -6
index 3815b94..b991102 100644
@@ -63,13 +63,8 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 static int arasan_sdhci_bind(struct udevice *dev)
 {
 	struct arasan_sdhci_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id arasan_sdhci_ids[] = {
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 1/8 mmc: squash lines for immediate return

Quoted 10 lines · Masahiro Yamada

These functions can be much simpler by squashing lines for immediate return.

For *_bind() callbacks, they will be a simple wrapper function of an upper-level bind API.

For mmc_set_{boot_bus_width,part_conf}, they will be a wrapper of mmc_switch().

Best Regards,
Jaehoon Chung

Quoted 200 lines

---

Changes in v3: None

 drivers/mmc/atmel_sdhci.c     |  7 +------
 drivers/mmc/exynos_dw_mmc.c   |  7 +------
 drivers/mmc/mmc_boot.c        | 28 ++++++++--------------------
 drivers/mmc/msm_sdhci.c       |  7 +------
 drivers/mmc/rockchip_dw_mmc.c |  7 +------
 drivers/mmc/rockchip_sdhci.c  |  7 +------
 drivers/mmc/sandbox_mmc.c     |  7 +------
 drivers/mmc/zynq_sdhci.c      |  7 +------
 8 files changed, 15 insertions(+), 62 deletions(-)
drivers/mmc/atmel_sdhci.c +1 -6
index dd6bd33..d8f8087 100644
@@ -136,13 +136,8 @@ static int atmel_sdhci_probe(struct udevice *dev)
 static int atmel_sdhci_bind(struct udevice *dev)
 {
 	struct atmel_sdhci_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id atmel_sdhci_ids[] = {
drivers/mmc/exynos_dw_mmc.c +1 -6
index 57271f1..568fed7 100644
@@ -284,13 +284,8 @@ static int exynos_dwmmc_probe(struct udevice *dev)
 static int exynos_dwmmc_bind(struct udevice *dev)
 {
 	struct exynos_mmc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = dwmci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dwmci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id exynos_dwmmc_ids[] = {
drivers/mmc/mmc_boot.c +8 -20
index 756a982..ac6f56f 100644
@@ -85,16 +85,10 @@ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
  */
 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
 {
-	int err;
-
-	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
-			 EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
-			 EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
-			 EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
-
-	if (err)
-		return err;
-	return 0;
+	return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
+			  EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
+			  EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
+			  EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
 }
 
 /*
@@ -106,16 +100,10 @@ int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
  */
 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
 {
-	int err;
-
-	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
-			 EXT_CSD_BOOT_ACK(ack) |
-			 EXT_CSD_BOOT_PART_NUM(part_num) |
-			 EXT_CSD_PARTITION_ACCESS(access));
-
-	if (err)
-		return err;
-	return 0;
+	return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
+			  EXT_CSD_BOOT_ACK(ack) |
+			  EXT_CSD_BOOT_PART_NUM(part_num) |
+			  EXT_CSD_PARTITION_ACCESS(access));
 }
 
 /*
drivers/mmc/msm_sdhci.c +1 -6
index 8d4399e..1b82991 100644
@@ -190,13 +190,8 @@ static int msm_ofdata_to_platdata(struct udevice *dev)
 static int msm_sdc_bind(struct udevice *dev)
 {
 	struct msm_sdhc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id msm_mmc_ids[] = {
drivers/mmc/rockchip_dw_mmc.c +1 -6
index 020a59b..859760b 100644
@@ -142,13 +142,8 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 static int rockchip_dwmmc_bind(struct udevice *dev)
 {
 	struct rockchip_mmc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = dwmci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dwmci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id rockchip_dwmmc_ids[] = {
drivers/mmc/rockchip_sdhci.c +1 -6
index 624029b..c56e1a3 100644
@@ -62,13 +62,8 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 static int rockchip_sdhci_bind(struct udevice *dev)
 {
 	struct rockchip_sdhc_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id arasan_sdhci_ids[] = {
drivers/mmc/sandbox_mmc.c +1 -6
index 5f1333b..fdb29a5 100644
@@ -112,7 +112,6 @@ int sandbox_mmc_bind(struct udevice *dev)
 {
 	struct sandbox_mmc_plat *plat = dev_get_platdata(dev);
 	struct mmc_config *cfg = &plat->cfg;
-	int ret;
 
 	cfg->name = dev->name;
 	cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT;
@@ -121,11 +120,7 @@ int sandbox_mmc_bind(struct udevice *dev)
 	cfg->f_max = 52000000;
 	cfg->b_max = U32_MAX;
 
-	ret = mmc_bind(dev, &plat->mmc, cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mmc_bind(dev, &plat->mmc, cfg);
 }
 
 int sandbox_mmc_unbind(struct udevice *dev)
drivers/mmc/zynq_sdhci.c +1 -6
index 3815b94..b991102 100644
@@ -63,13 +63,8 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 static int arasan_sdhci_bind(struct udevice *dev)
 {
 	struct arasan_sdhci_plat *plat = dev_get_platdata(dev);
-	int ret;
 
-	ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return sdhci_bind(dev, &plat->mmc, &plat->cfg);
 }
 
 static const struct udevice_id arasan_sdhci_ids[] = {
#3 lore raw

PATCH v3 1/8 mmc: squash lines for immediate return

In reply to Masahiro Yamada
Quoted 11 lines · Masahiro Yamada

These functions can be much simpler by squashing lines for immediate return.

For *_bind() callbacks, they will be a simple wrapper function of an upper-level bind API.

For mmc_set_{boot_bus_width,part_conf}, they will be a wrapper of mmc_switch().

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/8bdb2660/attachment-0001.sig>
#4 lore raw

PATCH v3 2/8 video: squash lines for immediate return

In reply to Masahiro Yamada

For vidconsole_post_probe(), it is common coding style to let a probe method return the value of a register function.

The others will become simple wrapper functions.

---

Changes in v3:
- Two more fixes
- s/resister/register/

 drivers/video/bridge/ptn3460.c            | 7 +------
 drivers/video/broadwell_igd.c             | 5 +----
 drivers/video/exynos/exynos_dp_lowlevel.c | 6 +-----
 drivers/video/tegra124/display.c          | 8 +-------
 drivers/video/vidconsole-uclass.c         | 6 +-----
 5 files changed, 5 insertions(+), 27 deletions(-)
drivers/video/bridge/ptn3460.c +1 -6
index 2e2ae7c..f9d3720 100644
@@ -11,14 +11,9 @@
 
 static int ptn3460_attach(struct udevice *dev)
 {
-	int ret;
-
 	debug("%s: %s\n", __func__, dev->name);
-	ret = video_bridge_set_active(dev, true);
-	if (ret)
-		return ret;
 
-	return 0;
+	return video_bridge_set_active(dev, true);
 }
 
 struct video_bridge_ops ptn3460_ops = {
drivers/video/broadwell_igd.c +1 -4
index ce4f296..4286fd0 100644
@@ -323,10 +323,7 @@ err:
 static unsigned long gtt_read(struct broadwell_igd_priv *priv,
 			      unsigned long reg)
 {
-	u32 val;
-
-	val = readl(priv->regs + reg);
-	return val;
+	return readl(priv->regs + reg);
 }
 
 static void gtt_write(struct broadwell_igd_priv *priv, unsigned long reg,
drivers/video/exynos/exynos_dp_lowlevel.c +1 -5
index f978473..aae78a8 100644
@@ -881,11 +881,7 @@ void exynos_dp_set_lane_count(struct exynos_dp *dp_regs, unsigned char count)
 
 unsigned int exynos_dp_get_lane_count(struct exynos_dp *dp_regs)
 {
-	unsigned int reg;
-
-	reg = readl(&dp_regs->lane_count_set);
-
-	return reg;
+	return readl(&dp_regs->lane_count_set);
 }
 
 unsigned char exynos_dp_get_lanex_pre_emphasis(struct exynos_dp *dp_regs,
drivers/video/tegra124/display.c +1 -7
index 2f1f0df..d8999c3 100644
@@ -326,13 +326,7 @@ static int display_update_config_from_edid(struct udevice *dp_dev,
 					   int *panel_bppp,
 					   struct display_timing *timing)
 {
-	int ret;
-
-	ret = display_read_timing(dp_dev, timing);
-	if (ret)
-		return ret;
-
-	return 0;
+	return display_read_timing(dp_dev, timing);
 }
 
 static int display_init(struct udevice *dev, void *lcdbase,
drivers/video/vidconsole-uclass.c +1 -5
index c8cc05e..e9a90b1 100644
@@ -190,7 +190,6 @@ static int vidconsole_post_probe(struct udevice *dev)
 {
 	struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
 	struct stdio_dev *sdev = &priv->sdev;
-	int ret;
 
 	if (!priv->tab_width_frac)
 		priv->tab_width_frac = VID_TO_POS(priv->x_charsize) * 8;
@@ -206,11 +205,8 @@ static int vidconsole_post_probe(struct udevice *dev)
 	sdev->putc = vidconsole_putc;
 	sdev->puts = vidconsole_puts;
 	sdev->priv = dev;
-	ret = stdio_register(sdev);
-	if (ret)
-		return ret;
 
-	return 0;
+	return stdio_register(sdev);
 }
 
 UCLASS_DRIVER(vidconsole) = {
Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 2/8 video: squash lines for immediate return

Quoted 13 lines · Masahiro Yamada

For vidconsole_post_probe(), it is common coding style to let a probe method return the value of a register function.

The others will become simple wrapper functions.

---

Changes in v3:
- Two more fixes
- s/resister/register/

Quoted 6 lines
 drivers/video/bridge/ptn3460.c            | 7 +------
 drivers/video/broadwell_igd.c             | 5 +----
 drivers/video/exynos/exynos_dp_lowlevel.c | 6 +-----
 drivers/video/tegra124/display.c          | 8 +-------
 drivers/video/vidconsole-uclass.c         | 6 +-----
 5 files changed, 5 insertions(+), 27 deletions(-)
#7 lore raw

PATCH v3 2/8 video: squash lines for immediate return

In reply to Masahiro Yamada
Quoted 9 lines · Masahiro Yamada

For vidconsole_post_probe(), it is common coding style to let a probe method return the value of a register function.

The others will become simple wrapper functions.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/c5935594/attachment.sig>
#8 lore raw

PATCH v3 3/8 usb: replace ehci_*_remove() with usb_deregister()

In reply to Masahiro Yamada

The remove callbacks of EHCI drivers are often just a wrapper of ehci_deregister.

---

Changes in v3:
- added

 drivers/usb/host/ehci-atmel.c   | 13 +------------
 drivers/usb/host/ehci-fsl.c     | 13 +------------
 drivers/usb/host/ehci-generic.c |  7 +------
 drivers/usb/host/ehci-marvell.c | 13 +------------
 drivers/usb/host/ehci-mx6.c     | 13 +------------
 drivers/usb/host/ehci-pci.c     | 13 +------------
 drivers/usb/host/ehci-tegra.c   | 13 +------------
 drivers/usb/host/ehci-zynq.c    | 13 +------------
 8 files changed, 8 insertions(+), 90 deletions(-)
drivers/usb/host/ehci-atmel.c +1 -12
index d65bbe9..2b138c5 100644
@@ -128,17 +128,6 @@ static int ehci_atmel_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
 }
 
-static int ehci_atmel_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "atmel,at91sam9g45-ehci", },
 	{ }
@@ -149,7 +138,7 @@ U_BOOT_DRIVER(ehci_atmel) = {
 	.id		= UCLASS_USB,
 	.of_match	= ehci_usb_ids,
 	.probe		= ehci_atmel_probe,
-	.remove		= ehci_atmel_remove,
+	.remove		= ehci_deregister,
 	.ops		= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct ehci_atmel_priv),
drivers/usb/host/ehci-fsl.c +1 -12
index f5e3ae7..9c32921 100644
@@ -118,17 +118,6 @@ static int ehci_fsl_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, &fsl_ehci_ops, 0, USB_INIT_HOST);
 }
 
-static int ehci_fsl_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "fsl-usb2-mph", },
 	{ .compatible = "fsl-usb2-dr", },
@@ -141,7 +130,7 @@ U_BOOT_DRIVER(ehci_fsl) = {
 	.of_match = ehci_usb_ids,
 	.ofdata_to_platdata = ehci_fsl_ofdata_to_platdata,
 	.probe = ehci_fsl_probe,
-	.remove = ehci_fsl_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct ehci_fsl_priv),
drivers/usb/host/ehci-generic.c +1 -6
index e0377ca..6291ed2 100644
@@ -44,11 +44,6 @@ static int ehci_usb_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
 }
 
-static int ehci_usb_remove(struct udevice *dev)
-{
-	return ehci_deregister(dev);
-}
-
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "generic-ehci" },
 	{ }
@@ -59,7 +54,7 @@ U_BOOT_DRIVER(ehci_generic) = {
 	.id	= UCLASS_USB,
 	.of_match = ehci_usb_ids,
 	.probe = ehci_usb_probe,
-	.remove = ehci_usb_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.priv_auto_alloc_size = sizeof(struct generic_ehci),
 	.flags	= DM_FLAG_ALLOC_PRIV_DMA,
drivers/usb/host/ehci-marvell.c +1 -12
index 5b0f46a..253fcb3 100644
@@ -94,17 +94,6 @@ static int ehci_mvebu_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
 }
 
-static int ehci_mvebu_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "marvell,orion-ehci", },
 	{ }
@@ -115,7 +104,7 @@ U_BOOT_DRIVER(ehci_mvebu) = {
 	.id	= UCLASS_USB,
 	.of_match = ehci_usb_ids,
 	.probe = ehci_mvebu_probe,
-	.remove = ehci_mvebu_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct ehci_mvebu_priv),
drivers/usb/host/ehci-mx6.c +1 -12
index 602fec5..48889c1 100644
@@ -451,17 +451,6 @@ static int ehci_usb_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, &mx6_ehci_ops, 0, priv->init_type);
 }
 
-static int ehci_usb_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id mx6_usb_ids[] = {
 	{ .compatible = "fsl,imx27-usb" },
 	{ }
@@ -472,7 +461,7 @@ U_BOOT_DRIVER(usb_mx6) = {
 	.id	= UCLASS_USB,
 	.of_match = mx6_usb_ids,
 	.probe	= ehci_usb_probe,
-	.remove = ehci_usb_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct ehci_mx6_priv_data),
drivers/usb/host/ehci-pci.c +1 -12
index f21a1fa..6fc2479 100644
@@ -126,17 +126,6 @@ static int ehci_pci_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
 }
 
-static int ehci_pci_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_pci_ids[] = {
 	{ .compatible = "ehci-pci" },
 	{ }
@@ -146,7 +135,7 @@ U_BOOT_DRIVER(ehci_pci) = {
 	.name	= "ehci_pci",
 	.id	= UCLASS_USB,
 	.probe = ehci_pci_probe,
-	.remove = ehci_pci_remove,
+	.remove = ehci_deregister,
 	.of_match = ehci_pci_ids,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
drivers/usb/host/ehci-tegra.c +1 -12
index 31d54ab..d3acaae 100644
@@ -846,17 +846,6 @@ static int ehci_usb_probe(struct udevice *dev)
 			     plat->init_type);
 }
 
-static int ehci_usb_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "nvidia,tegra20-ehci", .data = USB_CTLR_T20 },
 	{ .compatible = "nvidia,tegra30-ehci", .data = USB_CTLR_T30 },
@@ -871,7 +860,7 @@ U_BOOT_DRIVER(usb_ehci) = {
 	.of_match = ehci_usb_ids,
 	.ofdata_to_platdata = ehci_usb_ofdata_to_platdata,
 	.probe = ehci_usb_probe,
-	.remove = ehci_usb_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct fdt_usb),
drivers/usb/host/ehci-zynq.c +1 -12
index 76642cd..1e3b800 100644
@@ -73,17 +73,6 @@ static int ehci_zynq_probe(struct udevice *dev)
 	return ehci_register(dev, hccr, hcor, NULL, 0, plat->init_type);
 }
 
-static int ehci_zynq_remove(struct udevice *dev)
-{
-	int ret;
-
-	ret = ehci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static const struct udevice_id ehci_zynq_ids[] = {
 	{ .compatible = "xlnx,zynq-usb-2.20a" },
 	{ }
@@ -95,7 +84,7 @@ U_BOOT_DRIVER(ehci_zynq) = {
 	.of_match = ehci_zynq_ids,
 	.ofdata_to_platdata = ehci_zynq_ofdata_to_platdata,
 	.probe = ehci_zynq_probe,
-	.remove = ehci_zynq_remove,
+	.remove = ehci_deregister,
 	.ops	= &ehci_usb_ops,
 	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.priv_auto_alloc_size = sizeof(struct zynq_ehci_priv),
Signature · 1 line
1.9.1
#10 lore raw

PATCH v3 3/8 usb: replace ehci_*_remove() with usb_deregister()

In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

The remove callbacks of EHCI drivers are often just a wrapper of ehci_deregister.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/444d75b6/attachment.sig>
#11 lore raw

PATCH v3 4/8 usb: squash lines for immediate return

In reply to Masahiro Yamada

This makes functions much simpler.

---

Changes in v3: None

 common/usb.c                | 20 +++++++-------------
 common/usb_kbd.c            |  5 +----
 common/usb_storage.c        |  9 +++------
 drivers/usb/host/xhci-fsl.c |  7 +------
 4 files changed, 12 insertions(+), 29 deletions(-)
common/usb.c +7 -13
index b3ba487..15e1e4c 100644
@@ -557,12 +557,10 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
 static int usb_get_descriptor(struct usb_device *dev, unsigned char type,
 			unsigned char index, void *buf, int size)
 {
-	int res;
-	res = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-			USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
-			(type << 8) + index, 0,
-			buf, size, USB_CNTL_TIMEOUT);
-	return res;
+	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+			       USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
+			       (type << 8) + index, 0, buf, size,
+			       USB_CNTL_TIMEOUT);
 }
 
 /**********************************************************************
@@ -612,14 +610,10 @@ int usb_get_configuration_no(struct usb_device *dev, int cfgno,
  */
 static int usb_set_address(struct usb_device *dev)
 {
-	int res;
-
 	debug("set address %d\n", dev->devnum);
-	res = usb_control_msg(dev, usb_snddefctrl(dev),
-				USB_REQ_SET_ADDRESS, 0,
-				(dev->devnum), 0,
-				NULL, 0, USB_CNTL_TIMEOUT);
-	return res;
+
+	return usb_control_msg(dev, usb_snddefctrl(dev), USB_REQ_SET_ADDRESS,
+			       0, (dev->devnum), 0, NULL, 0, USB_CNTL_TIMEOUT);
 }
 
 /********************************************************************
common/usb_kbd.c +1 -4
index 97f79f8..a9872a6 100644
@@ -605,11 +605,8 @@ int usb_kbd_deregister(int force)
 static int usb_kbd_probe(struct udevice *dev)
 {
 	struct usb_device *udev = dev_get_parent_priv(dev);
-	int ret;
-
-	ret = probe_usb_keyboard(udev);
 
-	return ret;
+	return probe_usb_keyboard(udev);
 }
 
 static int usb_kbd_remove(struct udevice *dev)
common/usb_storage.c +3 -6
index 7e6e52d..0345aa2 100644
@@ -708,13 +708,10 @@ static int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
 /* clear a stall on an endpoint - special for BBB devices */
 static int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt)
 {
-	int result;
-
 	/* ENDPOINT_HALT = 0, so set value to 0 */
-	result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0),
-				USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT,
-				0, endpt, NULL, 0, USB_CNTL_TIMEOUT * 5);
-	return result;
+	return usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0),
+			       USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0,
+			       endpt, NULL, 0, USB_CNTL_TIMEOUT * 5);
 }
 
 static int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
drivers/usb/host/xhci-fsl.c +1 -6
index bdcd4f1..6ff450c 100644
@@ -129,15 +129,10 @@ static int xhci_fsl_probe(struct udevice *dev)
 static int xhci_fsl_remove(struct udevice *dev)
 {
 	struct xhci_fsl_priv *priv = dev_get_priv(dev);
-	int ret;
 
 	fsl_xhci_core_exit(&priv->ctx);
 
-	ret = xhci_deregister(dev);
-	if (ret)
-		return ret;
-
-	return 0;
+	return xhci_deregister(dev);
 }
 
 static const struct udevice_id xhci_usb_ids[] = {
Signature · 1 line
1.9.1
#12 lore raw

PATCH v3 4/8 usb: squash lines for immediate return

Quoted 3 lines · Masahiro Yamada

This makes functions much simpler.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/6cc3f712/attachment.sig>
#13 lore raw

PATCH v3 5/8 x86: squash lines for immediate return

In reply to Masahiro Yamada

arch_cpu_init() can be simpler by this refactoring.

---

Changes in v3: None

 arch/x86/cpu/baytrail/valleyview.c | 8 +-------
 arch/x86/cpu/ivybridge/ivybridge.c | 8 +-------
 arch/x86/cpu/qemu/qemu.c           | 8 +-------
 arch/x86/cpu/queensbay/tnc.c       | 8 +-------
 4 files changed, 4 insertions(+), 28 deletions(-)
arch/x86/cpu/baytrail/valleyview.c +1 -7
index b31f24e..b312d9f 100644
@@ -25,15 +25,9 @@ int cpu_mmc_init(bd_t *bis)
 #ifndef CONFIG_EFI_APP
 int arch_cpu_init(void)
 {
-	int ret;
-
 	post_code(POST_CPU_INIT);
 
-	ret = x86_cpu_init_f();
-	if (ret)
-		return ret;
-
-	return 0;
+	return x86_cpu_init_f();
 }
 
 int arch_misc_init(void)
arch/x86/cpu/ivybridge/ivybridge.c +1 -7
index c770b53..e817eb9 100644
@@ -10,13 +10,7 @@
 
 int arch_cpu_init(void)
 {
-	int ret;
-
 	post_code(POST_CPU_INIT);
 
-	ret = x86_cpu_init_f();
-	if (ret)
-		return ret;
-
-	return 0;
+	return x86_cpu_init_f();
 }
arch/x86/cpu/qemu/qemu.c +1 -7
index 680e558..c3092f2 100644
@@ -139,15 +139,9 @@ static void qemu_chipset_init(void)
 
 int arch_cpu_init(void)
 {
-	int ret;
-
 	post_code(POST_CPU_INIT);
 
-	ret = x86_cpu_init_f();
-	if (ret)
-		return ret;
-
-	return 0;
+	return x86_cpu_init_f();
 }
 
 #ifndef CONFIG_EFI_STUB
arch/x86/cpu/queensbay/tnc.c +1 -7
index b226e4c..f307c62 100644
@@ -94,15 +94,9 @@ static int __maybe_unused disable_igd(void)
 
 int arch_cpu_init(void)
 {
-	int ret;
-
 	post_code(POST_CPU_INIT);
 
-	ret = x86_cpu_init_f();
-	if (ret)
-		return ret;
-
-	return 0;
+	return x86_cpu_init_f();
 }
 
 int arch_early_init_r(void)
Signature · 1 line
1.9.1
#14 lore raw

PATCH v3 5/8 x86: squash lines for immediate return

Quoted 5 lines · Masahiro Yamada

arch_cpu_init() can be simpler by this refactoring.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/17b30c54/attachment.sig>
#15 lore raw

PATCH v3 6/8 libfdt: simplify fdt_del_mem_rsv()

In reply to Masahiro Yamada

The variable "err" is unneeded.

[ Device Tree Compiler commit: 36fd7331fb11276c09a6affc0d8cd4977f2fe100 ]

---

Changes in v3: None

 lib/libfdt/fdt_rw.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
lib/libfdt/fdt_rw.c +1 -5
index e7321cc..47447b2 100644
@@ -148,17 +148,13 @@ int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
 int fdt_del_mem_rsv(void *fdt, int n)
 {
 	struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
-	int err;
 
 	FDT_RW_CHECK_HEADER(fdt);
 
 	if (n >= fdt_num_mem_rsv(fdt))
 		return -FDT_ERR_NOTFOUND;
 
-	err = _fdt_splice_mem_rsv(fdt, re, 1, 0);
-	if (err)
-		return err;
-	return 0;
+	return _fdt_splice_mem_rsv(fdt, re, 1, 0);
 }
 
 static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
Signature · 1 line
1.9.1
#17 lore raw

PATCH v3 6/8 libfdt: simplify fdt_del_mem_rsv()

In reply to Masahiro Yamada
Quoted 7 lines · Masahiro Yamada

The variable "err" is unneeded.

[ Device Tree Compiler commit: 36fd7331fb11276c09a6affc0d8cd4977f2fe100 ]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/ef22935b/attachment.sig>
#18 lore raw

PATCH v3 7/8 arch, board: squash lines for immediate return

In reply to Masahiro Yamada

Remove unneeded variables and assignments.

---

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

PATCH v3 7/8 arch, board: squash lines for immediate return

On 6 September 2016 at 22:17, Masahiro Yamada <[email protected]

Quoted 42 lines

wrote:

Remove unneeded variables and assignments.

---

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(-)
board/samsung/goni/goni.c +0 -2
index 1600568..e8329bb 100644
@@ -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

board/samsung/goni/goni.c void i2c_init_board(void) · line 55

Quoted 10 lines
board/samsung/goni/goni.c +1 -5
         */
-       ret = pmic_init(I2C_0);
-       if (ret)
-               return ret;
-
-       return 0;
+       return pmic_init(I2C_0);
 }
 
 int dram_init(void)

Thanks,
Minkyu Kang.

Signature · 1 line
from. prom.
#20 lore raw

PATCH v3 7/8 arch, board: squash lines for immediate return

In reply to Masahiro Yamada
Quoted 301 lines · Masahiro Yamada

Remove unneeded variables and assignments.

---

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

board/ti/omap5_uevm/evm.c int ehci_hcd_init(int index, enum usb_init_type init, · line 251

Quoted 10 lines
board/ti/omap5_uevm/evm.c +1 -4
 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)

Many thanks,
Angelo Dureghello

#21 lore raw

PATCH v3 7/8 arch, board: squash lines for immediate return

In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

Remove unneeded variables and assignments.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/b0cf456c/attachment.sig>
#22 lore raw

PATCH v3 8/8 drivers: squash lines for immediate return

In reply to Masahiro Yamada

Remove unneeded variables and assignments.

---

Changes in v3:
- more changes

 drivers/block/sym53c8xx.c            |  5 ++---
 drivers/ddr/fsl/ddr1_dimm_params.c   | 12 ++----------
 drivers/ddr/fsl/ddr2_dimm_params.c   | 12 ++----------
 drivers/ddr/marvell/a38x/ddr3_a38x.c |  6 +-----
 drivers/power/axp809.c               |  8 +-------
 drivers/rtc/m48t35ax.c               |  4 +---
 6 files changed, 9 insertions(+), 38 deletions(-)
drivers/block/sym53c8xx.c +2 -3
index 5daede7..50043e6 100644
@@ -284,9 +284,8 @@ void scsi_low_level_init(int busdevfunc)
  */
 unsigned long swap_script(unsigned long val)
 {
-	unsigned long tmp;
-	tmp = ((val>>24)&0xff) | ((val>>8)&0xff00) | ((val<<8)&0xff0000) | ((val<<24)&0xff000000);
-	return tmp;
+	return ((val >> 24) & 0xff) | ((val >> 8) & 0xff00) |
+		((val << 8) & 0xff0000) | ((val << 24) & 0xff000000);
 }
 
 
drivers/ddr/fsl/ddr1_dimm_params.c +2 -10
index 00cdc22..369b325 100644
@@ -108,22 +108,14 @@ static unsigned int byte40_table_ps[8] = {
 static unsigned int
 compute_trfc_ps_from_spd(unsigned char trctrfc_ext, unsigned char trfc)
 {
-	unsigned int trfc_ps;
-
-	trfc_ps = (((trctrfc_ext & 0x1) * 256) + trfc) * 1000
+	return ((trctrfc_ext & 0x1) * 256 + trfc) * 1000
 		+ byte40_table_ps[(trctrfc_ext >> 1) & 0x7];
-
-	return trfc_ps;
 }
 
 static unsigned int
 compute_trc_ps_from_spd(unsigned char trctrfc_ext, unsigned char trc)
 {
-	unsigned int trc_ps;
-
-	trc_ps = trc * 1000 + byte40_table_ps[(trctrfc_ext >> 4) & 0x7];
-
-	return trc_ps;
+	return trc * 1000 + byte40_table_ps[(trctrfc_ext >> 4) & 0x7];
 }
 
 /*
drivers/ddr/fsl/ddr2_dimm_params.c +2 -10
index 59baf6b..af752cc 100644
@@ -107,22 +107,14 @@ static unsigned int byte40_table_ps[8] = {
 static unsigned int
 compute_trfc_ps_from_spd(unsigned char trctrfc_ext, unsigned char trfc)
 {
-	unsigned int trfc_ps;
-
-	trfc_ps = (((trctrfc_ext & 0x1) * 256) + trfc) * 1000
+	return (((trctrfc_ext & 0x1) * 256) + trfc) * 1000
 		+ byte40_table_ps[(trctrfc_ext >> 1) & 0x7];
-
-	return trfc_ps;
 }
 
 static unsigned int
 compute_trc_ps_from_spd(unsigned char trctrfc_ext, unsigned char trc)
 {
-	unsigned int trc_ps;
-
-	trc_ps = trc * 1000 + byte40_table_ps[(trctrfc_ext >> 4) & 0x7];
-
-	return trc_ps;
+	return trc * 1000 + byte40_table_ps[(trctrfc_ext >> 4) & 0x7];
 }
 
 /*
drivers/ddr/marvell/a38x/ddr3_a38x.c +1 -5
index f469907..c082122 100644
@@ -706,11 +706,7 @@ int ddr3_tip_ext_write(u32 dev_num, u32 if_id, u32 reg_addr,
 
 int ddr3_silicon_pre_init(void)
 {
-	int result;
-
-	result = ddr3_silicon_init();
-
-	return result;
+	return ddr3_silicon_init();
 }
 
 int ddr3_post_run_alg(void)
drivers/power/axp809.c +1 -7
index c8b76cf..c5b608d 100644
@@ -217,13 +217,7 @@ int axp_set_sw(bool on)
 
 int axp_init(void)
 {
-	int ret;
-
-	ret = pmic_bus_init();
-	if (ret)
-		return ret;
-
-	return 0;
+	return pmic_bus_init();
 }
 
 int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
drivers/rtc/m48t35ax.c +1 -3
index 021b91f..36011a5 100644
@@ -127,10 +127,8 @@ void rtc_reset (void)
 
 static uchar rtc_read (uchar reg)
 {
-	uchar val;
-	val = *(unsigned char *)
+	return *(unsigned char *)
 		((CONFIG_SYS_NVRAM_BASE_ADDR + CONFIG_SYS_NVRAM_SIZE - 8) + reg);
-	return val;
 }
 
 static void rtc_write (uchar reg, uchar val)
Signature · 1 line
1.9.1
#23 lore raw

PATCH v3 8/8 drivers: squash lines for immediate return

Quoted 3 lines · Masahiro Yamada

Remove unneeded variables and assignments.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/9b3db6ed/attachment.sig>