summaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-12-08 14:17:08 +0100
committerHans de Goede <hdegoede@redhat.com>2015-01-14 14:56:37 +0100
commit2367b44d0f40f8be0e82c5df459b7ec5fc3f0155 (patch)
treeabe58916c8d3e42f94eec0cdb0224326d0b31696 /arch/arm/include
parent5665f50e81fc76932307fa2351357517af31fefa (diff)
downloadtalos-obmc-uboot-2367b44d0f40f8be0e82c5df459b7ec5fc3f0155.tar.gz
talos-obmc-uboot-2367b44d0f40f8be0e82c5df459b7ec5fc3f0155.zip
sunxi: Use memcmp for mctl_mem_matches
Use memcmp for mctl_mem_matches instead of DIY. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/arch-sunxi/dram.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h
index 0bf718c3a4..a8a37d57f8 100644
--- a/arch/arm/include/asm/arch-sunxi/dram.h
+++ b/arch/arm/include/asm/arch-sunxi/dram.h
@@ -55,15 +55,9 @@ static inline void mctl_mem_fill(void)
*/
static inline bool mctl_mem_matches(u32 offset)
{
- int i, matches = 0;
-
- for (i = 0; i < MCTL_MEM_FILL_MATCH_COUNT; i++) {
- if (readl(CONFIG_SYS_SDRAM_BASE + i * 4) ==
- readl(CONFIG_SYS_SDRAM_BASE + offset + i * 4))
- matches++;
- }
-
- return matches == MCTL_MEM_FILL_MATCH_COUNT;
+ return memcmp((u32 *)CONFIG_SYS_SDRAM_BASE,
+ (u32 *)(CONFIG_SYS_SDRAM_BASE + offset),
+ MCTL_MEM_FILL_MATCH_COUNT * 4) == 0;
}
#endif /* _SUNXI_DRAM_H */
OpenPOWER on IntegriCloud