summaryrefslogtreecommitdiff
path: root/drivers/ddr
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-08-01 18:54:34 +0200
committerMarek Vasut <marex@denx.de>2015-08-08 14:14:25 +0200
commit791d20e13d241f6ef43ead0f2c3ee777f5981c5b (patch)
tree21f770b813dabb924c1a56469922e8aeab6a4f0b /drivers/ddr
parent58d86144d49b0b8baf421807fb6fff693e979378 (diff)
downloadu-boot-imx-791d20e13d241f6ef43ead0f2c3ee777f5981c5b.zip
u-boot-imx-791d20e13d241f6ef43ead0f2c3ee777f5981c5b.tar.gz
u-boot-imx-791d20e13d241f6ef43ead0f2c3ee777f5981c5b.tar.bz2
ddr: altera: sdram: Clean up compute_errata_rows() part 1
Clean up weird parenthesis and odd type casts from the function. Fix comment style. Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/ddr')
-rw-r--r--drivers/ddr/altera/sdram.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
index 9e6acfe..c60820c 100644
--- a/drivers/ddr/altera/sdram.c
+++ b/drivers/ddr/altera/sdram.c
@@ -54,13 +54,14 @@ static int compute_errata_rows(unsigned long long memsize, int cs, int width,
debug("workaround rows - banks %d\n", banks);
debug("workaround rows - cols %d\n", cols);
- newrows = lldiv(memsize, (cs * (width / 8)));
+ newrows = lldiv(memsize, cs * (width / 8));
debug("rows workaround - term1 %lld\n", newrows);
- newrows = lldiv(newrows, ((1 << banks) * (1 << cols)));
+ newrows = lldiv(newrows, (1 << banks) * (1 << cols));
debug("rows workaround - term2 %lld\n", newrows);
- /* Compute the hamming weight - same as number of bits set.
+ /*
+ * Compute the hamming weight - same as number of bits set.
* Need to see if result is ordinal power of 2 before
* attempting log2 of result.
*/
@@ -78,13 +79,12 @@ static int compute_errata_rows(unsigned long long memsize, int cs, int width,
return rows;
}
- inewrowslog2 = __ilog2((unsigned int)newrows);
+ inewrowslog2 = __ilog2(newrows);
- debug("rows workaround - ilog2 %d, %d\n", inewrowslog2,
- (int)newrows);
+ debug("rows workaround - ilog2 %d, %lld\n", inewrowslog2, newrows);
if (inewrowslog2 == -1) {
- printf("SDRAM workaround failed, newrows %d\n", (int)newrows);
+ printf("SDRAM workaround failed, newrows %lld\n", newrows);
return rows;
}