linux/drivers/mtd
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
..
chips mtd: Add a retlen parameter to _get_{fact,user}_prot_info 2014-03-10 22:42:28 -07:00
devices mtd: st_spi_fsm: correct type issues 2014-04-16 21:59:23 -07:00
lpddr mtd: lpddr: Remove unnecessary OOM messages 2014-03-10 22:42:24 -07:00
maps mtd: allow CONFIG_MTD_PHYSMAP_OF also for CONFIG_MTD_RAM 2014-03-10 22:42:29 -07:00
nand MTD updates for 3.15: 2014-04-07 10:17:30 -07:00
onenand mtd: Add a retlen parameter to _get_{fact,user}_prot_info 2014-03-10 22:42:28 -07:00
spi-nor mtd: fsl-quadspi: fix __iomem annotations 2014-04-16 02:14:06 -07:00
tests mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
ubi MTD updates for 3.15: 2014-04-07 10:17:30 -07:00
afs.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ar7part.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
bcm47xxpart.c mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X 2014-03-10 22:42:29 -07:00
bcm63xxpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
cmdlinepart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ftl.c mtd: do not use mtd->sync directly 2012-01-09 18:26:21 +00:00
inftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
inftlmount.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
Kconfig mtd: spi-nor: add the framework for SPI NOR 2014-04-14 11:22:58 -07:00
Makefile mtd: spi-nor: shorten Kconfig naming 2014-04-14 11:23:01 -07:00
mtd_blkdevs.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
mtdblock_ro.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdblock.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdchar.c mtd: Fix the behavior of OTP write if there is not enough room for data 2014-03-10 22:42:31 -07:00
mtdconcat.c mtd: unify initialization of erase_info->fail_addr 2012-03-27 01:02:24 +01:00
mtdcore.c mtd: Fix the behavior of OTP write if there is not enough room for data 2014-03-10 22:42:31 -07:00
mtdcore.h mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
mtdoops.c mtdoops: don't erase flash at each boot 2012-11-15 15:37:51 +02:00
mtdpart.c mtd: Add a retlen parameter to _get_{fact,user}_prot_info 2014-03-10 22:42:28 -07:00
mtdsuper.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdswap.c mtd: mtdswap: replace strict_strtoul() with kstrtoul() 2013-08-30 21:52:51 +01:00
nftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
nftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
ofpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
redboot.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
rfd_ftl.c mtd: remove some duplicative checks 2014-03-10 22:42:25 -07:00
sm_ftl.c mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes() 2014-03-10 22:42:21 -07:00
sm_ftl.h
ssfdc.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00