linux/drivers/mmc/card
Kuninori Morimoto 087de9ed3d mmc: cast unsigned int to typeof(sector_t) to avoid unexpected error
card->csd.capacity is defined as "unsigned int", and sector_t is defined as
"u64" or "unsigned long" (depends on CONFIG_LBDAF). Thus, sector_t data
might have strange data (see below). This patch cast it to typeof(sector_t)
Special thanks to coverity <http://www.coverity.com>

ex) if sector_t was u64

        unsigned int data;
        sector_t sector;

        data = 0x800000;
        sector = (data << 8); // 0xffffffff80000000
        sector = (((typeof(sector_t))data) << 8); // 0x80000000

or

        data = 0x80000000;
        sector = (data << 8); // 0x0
        sector = (((typeof(sector_t))data) << 8); // 0x8000000000

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-06-01 09:07:03 +02:00
..
block.c mmc: cast unsigned int to typeof(sector_t) to avoid unexpected error 2015-06-01 09:07:03 +02:00
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile
mmc_test.c mmc: card: mmc_test: Simplify a trivial if-return sequence 2015-06-01 09:07:01 +02:00
queue.c mmc: card: Don't access RPMB partitions for normal read/write 2015-05-06 14:55:12 +02:00
queue.h mmc: block: Retry errored data requests when re-tuning is needed 2015-06-01 09:06:59 +02:00
sdio_uart.c mmc: Convert pr_warning to pr_warn 2014-09-24 10:13:09 +02:00