mtd: onenand: samsung: Fix pointer cast -Wpointer-to-int-cast warnings on 64 bit
authorKrzysztof Kozlowski <krzk@kernel.org>
Sun, 29 Dec 2019 18:36:10 +0000 (19:36 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 21 Jan 2020 19:00:33 +0000 (20:00 +0100)
iomem pointers should be casted to unsigned long to avoid
-Wpointer-to-int-cast warnings when compiling on 64-bit platform (e.g.
with COMPILE_TEST):

    drivers/mtd/nand/onenand/samsung_mtd.c: In function ‘s3c_onenand_readw’:
    drivers/mtd/nand/onenand/samsung_mtd.c:251:6: warning:
        cast from pointer to integer of different size [-Wpointer-to-int-cast]
      if ((unsigned int) addr < ONENAND_DATARAM && onenand->bootram_command) {
          ^

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/onenand/samsung_mtd.c

index d61317a..2a75fa7 100644 (file)
@@ -248,7 +248,7 @@ static unsigned short s3c_onenand_readw(void __iomem *addr)
        }
 
        /* BootRAM access control */
-       if ((unsigned int) addr < ONENAND_DATARAM && onenand->bootram_command) {
+       if ((unsigned long)addr < ONENAND_DATARAM && onenand->bootram_command) {
                if (word_addr == 0)
                        return s3c_read_reg(MANUFACT_ID_OFFSET);
                if (word_addr == 1)
@@ -289,7 +289,7 @@ static void s3c_onenand_writew(unsigned short value, void __iomem *addr)
        }
 
        /* BootRAM access control */
-       if ((unsigned int)addr < ONENAND_DATARAM) {
+       if ((unsigned long)addr < ONENAND_DATARAM) {
                if (value == ONENAND_CMD_READID) {
                        onenand->bootram_command = 1;
                        return;