mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 08:31:03 +00:00
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>
This commit is contained in:
parent
5665f50e81
commit
2367b44d0f
1 changed files with 3 additions and 9 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue