Skip to content

Commit 14ebf24

Browse files
krzkmiquelraynal
authored andcommitted
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: kbuild test robot <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 44f4599 commit 14ebf24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mtd/nand/onenand/samsung_mtd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
675675
normal:
676676
if (count != mtd->writesize) {
677677
/* Copy the bufferram to memory to prevent unaligned access */
678-
memcpy(this->page_buf, p, mtd->writesize);
679-
p = this->page_buf + offset;
678+
memcpy_fromio(this->page_buf, p, mtd->writesize);
679+
memcpy(buffer, this->page_buf + offset, count);
680+
} else {
681+
memcpy_fromio(buffer, p, count);
680682
}
681683

682-
memcpy(buffer, p, count);
683-
684684
return 0;
685685
}
686686

0 commit comments

Comments
 (0)