diff options
author | Marek Vasut <marex@denx.de> | 2015-08-01 22:40:48 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-08-08 14:14:28 +0200 |
commit | a003740aec36a633f2183c034e620f618f6996ae (patch) | |
tree | c91931bda7f8fef9c3cf21674a314ab951387d7a | |
parent | 96b869b6e31193c0d89038181623cc8cc3015b19 (diff) | |
download | u-boot-imx-a003740aec36a633f2183c034e620f618f6996ae.zip u-boot-imx-a003740aec36a633f2183c034e620f618f6996ae.tar.gz u-boot-imx-a003740aec36a633f2183c034e620f618f6996ae.tar.bz2 |
ddr: altera: sdram: Minor cleanup in sdram_set_rule()
Zap an obscure unneeded cast and clean other minor nits in this function.
Signed-off-by: Marek Vasut <marex@denx.de>
-rw-r--r-- | drivers/ddr/altera/sdram.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c index e16f116..da7f27f 100644 --- a/drivers/ddr/altera/sdram.c +++ b/drivers/ddr/altera/sdram.c @@ -117,8 +117,8 @@ static void sdram_set_rule(struct sdram_prot_rule *prule) writel(ruleno, &sdr_ctrl->prot_rule_rdwr); /* Obtain the address bits */ - lo_addr_bits = (uint32_t)(((prule->sdram_start) >> 20ULL) & 0xFFF); - hi_addr_bits = (uint32_t)((((prule->sdram_end-1) >> 20ULL)) & 0xFFF); + lo_addr_bits = prule->sdram_start >> 20ULL; + hi_addr_bits = (prule->sdram_end - 1) >> 20ULL; debug("sdram set rule start %x, %lld\n", lo_addr_bits, prule->sdram_start); @@ -138,7 +138,7 @@ static void sdram_set_rule(struct sdram_prot_rule *prule) &sdr_ctrl->prot_rule_data); /* write the rule */ - writel(ruleno | (1L << 5), &sdr_ctrl->prot_rule_rdwr); + writel(ruleno | (1 << 5), &sdr_ctrl->prot_rule_rdwr); /* Set rule number to 0 by default */ writel(0, &sdr_ctrl->prot_rule_rdwr); @@ -183,7 +183,7 @@ static void sdram_set_protection_config(uint64_t sdram_start, uint64_t sdram_end writel(0x0, &sdr_ctrl->protport_default); /* Clear all protection rules for warm boot case */ - memset(&rule, 0, sizeof(struct sdram_prot_rule)); + memset(&rule, 0, sizeof(rule)); for (rules = 0; rules < 20; rules++) { rule.rule = rules; |