Remove unneeded variables and assignments.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
*/
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);
}
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];
}
/*
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];
}
/*
int ddr3_silicon_pre_init(void)
{
- int result;
-
- result = ddr3_silicon_init();
-
- return result;
+ return ddr3_silicon_init();
}
int ddr3_post_run_alg(void)
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[])
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)