mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 16:50:05 +00:00
mtd: rawnand: fsmc: Use uintptr_t casts instead of unsigned ones
uintptr_t should be used when casting a pointer to an unsigned int so that the code compiles without warnings even on 64-bit architectures. This is needed if we want to allow selection of this driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
8f3931ed97
commit
f55824c6fa
@ -547,7 +547,7 @@ static void fsmc_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
|
|||||||
struct fsmc_nand_data *host = mtd_to_fsmc(mtd);
|
struct fsmc_nand_data *host = mtd_to_fsmc(mtd);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (IS_ALIGNED((uint32_t)buf, sizeof(uint32_t)) &&
|
if (IS_ALIGNED((uintptr_t)buf, sizeof(uint32_t)) &&
|
||||||
IS_ALIGNED(len, sizeof(uint32_t))) {
|
IS_ALIGNED(len, sizeof(uint32_t))) {
|
||||||
uint32_t *p = (uint32_t *)buf;
|
uint32_t *p = (uint32_t *)buf;
|
||||||
len = len >> 2;
|
len = len >> 2;
|
||||||
@ -570,7 +570,7 @@ static void fsmc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
|
|||||||
struct fsmc_nand_data *host = mtd_to_fsmc(mtd);
|
struct fsmc_nand_data *host = mtd_to_fsmc(mtd);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (IS_ALIGNED((uint32_t)buf, sizeof(uint32_t)) &&
|
if (IS_ALIGNED((uintptr_t)buf, sizeof(uint32_t)) &&
|
||||||
IS_ALIGNED(len, sizeof(uint32_t))) {
|
IS_ALIGNED(len, sizeof(uint32_t))) {
|
||||||
uint32_t *p = (uint32_t *)buf;
|
uint32_t *p = (uint32_t *)buf;
|
||||||
len = len >> 2;
|
len = len >> 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user