]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: squash lines for immediate return
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 6 Sep 2016 13:17:39 +0000 (22:17 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2016 21:53:54 +0000 (17:53 -0400)
Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/block/sym53c8xx.c
drivers/ddr/fsl/ddr1_dimm_params.c
drivers/ddr/fsl/ddr2_dimm_params.c
drivers/ddr/marvell/a38x/ddr3_a38x.c
drivers/power/axp809.c
drivers/rtc/m48t35ax.c

index 5daede7279837b49eec2f57c88b3e4d1ba741c73..50043e68affd20567eafe4c44c0cb6be22a6e41a 100644 (file)
@@ -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);
 }
 
 
index 00cdc2240804810d64d73afe84b1ebad28ef0bbb..369b325ff2b7714db5c90a2836aa2834660b4f41 100644 (file)
@@ -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];
 }
 
 /*
index 59baf6b7a1017e47739722eff1666f046aa75533..af752cc96c6d366050fd07a6c16e4eb1ab8e2f61 100644 (file)
@@ -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];
 }
 
 /*
index f4699076e83fcfba4c89d0b6f90aa6ff333a09a5..c082122f25c38c4cc807e932af9d686a19eba78c 100644 (file)
@@ -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)
index c8b76cf9b7f257e4b893edfbab6c8097ac55808a..c5b608d2f0d0f3d243a23981a4adc5fe042272c8 100644 (file)
@@ -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[])
index 021b91f7313c7093731a65fa47914bdf52c3d4be..36011a5b8845ecff7756a75473f7063b020ec93d 100644 (file)
@@ -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)