[U-Boot] [PATCH v3 0/8] Clean-up: squash lines for immediate return

Masahiro Yamada yamada.masahiro at socionext.com
Tue Sep 6 15:17:31 CEST 2016


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(-)

-- 
1.9.1



More information about the U-Boot mailing list