Commit 14ebf241 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Miquel Raynal

mtd: onenand: samsung: Fix iomem access with regular memcpy

The __iomem memory should be copied with memcpy_fromio.  This fixes
Sparse warnings like:

    drivers/mtd/nand/onenand/samsung_mtd.c:678:40: warning: incorrect type in argument 2 (different address spaces)
    drivers/mtd/nand/onenand/samsung_mtd.c:678:40:    expected void const *from
    drivers/mtd/nand/onenand/samsung_mtd.c:678:40:    got void [noderef] <asn:2> *[assigned] p
    drivers/mtd/nand/onenand/samsung_mtd.c:679:19: warning: incorrect type in assignment (different address spaces)
    drivers/mtd/nand/onenand/samsung_mtd.c:679:19:    expected void [noderef] <asn:2> *[assigned] p
    drivers/mtd/nand/onenand/samsung_mtd.c:679:19:    got unsigned char *
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 44f45994
...@@ -675,12 +675,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, ...@@ -675,12 +675,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
normal: normal:
if (count != mtd->writesize) { if (count != mtd->writesize) {
/* Copy the bufferram to memory to prevent unaligned access */ /* Copy the bufferram to memory to prevent unaligned access */
memcpy(this->page_buf, p, mtd->writesize); memcpy_fromio(this->page_buf, p, mtd->writesize);
p = this->page_buf + offset; memcpy(buffer, this->page_buf + offset, count);
} else {
memcpy_fromio(buffer, p, count);
} }
memcpy(buffer, p, count);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment