mmc: fix capacity calculation when EXT_CSD_SEC_CNT is used
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Thu, 7 Jun 2012 19:09:11 +0000 (19:09 +0000)
committernotaz <notasas@gmail.com>
Thu, 29 Oct 2015 22:42:29 +0000 (00:42 +0200)
commit7e8ad86614031ac1f4374a9eb11900380c174caa
treee1a29fecee8733843ec2520a8db50b4c9b0a7594
parent8054c033b4cbef381c60e2252a15089df420bc74
mmc: fix capacity calculation when EXT_CSD_SEC_CNT is used

Since the type of "ext_csd" was array of char, the following
calculation might fail when the value of ext_csd[EXT_CSD_SEC_CNT]
was minus.

capacity = ext_csd[EXT_CSD_SEC_CNT] << 0
| ext_csd[EXT_CSD_SEC_CNT + 1] << 8
| ext_csd[EXT_CSD_SEC_CNT + 2] << 16
| ext_csd[EXT_CSD_SEC_CNT + 3] << 24;

So, this patch changes the type of "ext_csd" to array of u8.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
drivers/mmc/mmc.c