linux/drivers/mtd/devices
Brian Norris 38e2eee9ab mtd: st_spi_fsm: correct type issues
Compile-testing for a 64-bit arch uncovers several bad casts:

    In file included from include/linux/linkage.h:4:0,
                     from include/linux/kernel.h:6,
                     from drivers/mtd/devices/st_spi_fsm.c:15:
    drivers/mtd/devices/st_spi_fsm.c: In function ‘stfsm_read_fifo’:
    drivers/mtd/devices/st_spi_fsm.c:758:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3));
    ...

Use uintptr_t instead of uint32_t, since it's guaranteed to be
pointer-sized.

We also see this warning, if size_t is not 32 bits wide:

    In file included from drivers/mtd/devices/st_spi_fsm.c:15:0:
    drivers/mtd/devices/st_spi_fsm.c: In function ‘stfsm_mtd_write’:
    include/linux/kernel.h:712:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      (void) (&_min1 == &_min2);  \
                     ^
    drivers/mtd/devices/st_spi_fsm.c:1704:11: note: in expansion of macro ‘min’
       bytes = min(FLASH_PAGESIZE - page_offs, len);
               ^

Just use min_t() to force the type conversion, since we don't really
want to upgrade 'page_offs' and 'bytes' to size_t; they only should be
handling <= 256 byte offsets.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
2014-04-16 21:59:23 -07:00
..
bcm47xxsflash.c mtd: bcm47xxsflash: writing support 2013-08-30 21:52:20 +01:00
bcm47xxsflash.h mtd: bcm47xxsflash: implement ChipCommon R/W ops 2013-08-05 18:20:32 +01:00
block2mtd.c mtd: block2mtd: check device size 2014-03-10 22:42:31 -07:00
docg3.c mtd: docg3: Use devm_*() functions 2014-01-03 11:22:27 -08:00
docg3.h mtd: docg3 add protection against concurrency 2012-03-27 01:03:27 +01:00
elm.c mtd: devices: elm: update DRIVER_NAME as "omap-elm" 2014-03-25 23:09:06 -07:00
Kconfig mtd: st_spi_fsm: fixup Kconfig dependency 2014-04-14 11:23:01 -07:00
lart.c mtd: move zero length verification to MTD API functions 2012-03-27 00:32:19 +01:00
m25p80.c mtd: spi-nor: re-name OPCODE_* to SPINOR_OP_* 2014-04-14 11:23:00 -07:00
Makefile mtd: st_spi_fsm: Allocate resources and register with MTD framework 2014-03-20 04:17:14 -07:00
ms02-nv.c mtd: ms02-nv: remove superfluous name cast 2014-01-03 11:22:09 -08:00
ms02-nv.h MTD/JFFS2: remove CVS keywords 2008-06-04 17:50:17 +01:00
mtd_dataflash.c mtd: Fix the behavior of OTP write if there is not enough room for data 2014-03-10 22:42:31 -07:00
mtdram.c mtd: mtdram: add missing 'const' 2014-01-20 11:55:23 -08:00
phram.c mtd: phram: Repair multiple instances support 2014-03-10 22:42:21 -07:00
pmc551.c mtd: pmc551: Remove unnecessary OOM messages 2014-03-10 22:42:24 -07:00
serial_flash_cmds.h mtd: st_spi_fsm: begin using spi-nor.h opcodes 2014-04-14 11:23:01 -07:00
slram.c mtd: slram: invalid checking of absolute end address 2012-11-09 17:02:50 +02:00
spear_smi.c mtd: spear_smi: Remove unnecessary OOM messages 2014-03-10 22:42:24 -07:00
sst25l.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
st_spi_fsm.c mtd: st_spi_fsm: correct type issues 2014-04-16 21:59:23 -07:00