Skip to contentSkip to conversation

arm64: mvebu: incorrect check of fdt address cells

PATCH New Heinrich Schuchardt 2 participants 2 messages May 3, 2017 – May 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mvebu: incorrect check of fdt address cells

In dram_init_banksize there seems to be a typo concerning a plausibility check of the fdt.
Testing sc > 2 twice does not make any sense.

The problem was indicated by cppcheck.

---
I do not have a board for testing.
So review carefully.

---
 arch/arm/mach-mvebu/arm64-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mvebu/arm64-common.c +1 -1
index 1c0477a3ca..2ef5726905 100644
@@ -94,7 +94,7 @@ int dram_init_banksize(void)
 
 	ac = fdt_address_cells(fdt, 0);
 	sc = fdt_size_cells(fdt, 0);
-	if (ac < 1 || sc > 2 || sc < 1 || sc > 2) {
+	if (ac < 1 || ac > 2 || sc < 1 || sc > 2) {
 		printf("invalid address/size cells\n");
 		return -ENXIO;
 	}
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 arm64: mvebu: incorrect check of fdt address cells

Quoted 7 lines · xypron.glpk at gmx.de

In dram_init_banksize there seems to be a typo concerning a plausibility check of the fdt.
Testing sc > 2 twice does not make any sense.

The problem was indicated by cppcheck.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170506/f33b363a/attachment.sig>