Commit dd13b4ed authored by Jurgen Heeks's avatar Jurgen Heeks Committed by Chris Ball

mmc: core: Fix comparison issue in mmc_compare_ext_csds

Found this issue during code review. Actually, there are two issues which
both compensate together in lucky case.  In unlucky case the bus width
probing might not work as expected.
Signed-off-by: default avatarJurgen Heeks <jurgen.heeks@nokia.com>
Reviewed-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 3e73c36b
...@@ -376,7 +376,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) ...@@ -376,7 +376,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
} }
card->ext_csd.raw_hc_erase_gap_size = card->ext_csd.raw_hc_erase_gap_size =
ext_csd[EXT_CSD_PARTITION_ATTRIBUTE]; ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
card->ext_csd.raw_sec_trim_mult = card->ext_csd.raw_sec_trim_mult =
ext_csd[EXT_CSD_SEC_TRIM_MULT]; ext_csd[EXT_CSD_SEC_TRIM_MULT];
card->ext_csd.raw_sec_erase_mult = card->ext_csd.raw_sec_erase_mult =
...@@ -551,7 +551,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) ...@@ -551,7 +551,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
goto out; goto out;
/* only compare read only fields */ /* only compare read only fields */
err = (!(card->ext_csd.raw_partition_support == err = !((card->ext_csd.raw_partition_support ==
bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) && bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
(card->ext_csd.raw_erased_mem_count == (card->ext_csd.raw_erased_mem_count ==
bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment