From: Rafał Miłecki Date: Wed, 10 Dec 2014 10:49:53 +0000 (+0100) Subject: MIPS: BCM47XX: Use helpers for reading NVRAM content X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=23d2bc42aceb829eaf90c694941e4523c22865e8;p=linux-beck.git MIPS: BCM47XX: Use helpers for reading NVRAM content Also drop some unneeded memset-s. Signed-off-by: Rafał Miłecki Cc: Hauke Mehrtens Cc: Paul Walmsley Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/8661/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index c5c381c43f17..5e4ae042deb9 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c @@ -91,7 +91,6 @@ static int nvram_find_and_copy(void __iomem *iobase, u32 lim) return -ENXIO; found: - if (header->len > size) pr_err("The nvram size accoridng to the header seems to be bigger than the partition on flash\n"); if (header->len > NVRAM_SPACE) @@ -101,10 +100,9 @@ found: src = (u32 *) header; dst = (u32 *) nvram_buf; for (i = 0; i < sizeof(struct nvram_header); i += 4) - *dst++ = *src++; + *dst++ = __raw_readl(src++); for (; i < header->len && i < NVRAM_SPACE && i < size; i += 4) - *dst++ = le32_to_cpu(*src++); - memset(dst, 0x0, NVRAM_SPACE - i); + *dst++ = readl(src++); return 0; } @@ -165,7 +163,6 @@ static int nvram_init(void) err = mtd_read(mtd, from, len, &bytes_read, dst); if (err) return err; - memset(dst + bytes_read, 0x0, NVRAM_SPACE - bytes_read); return 0; }