mmc:core: Fix comparison issue in mmc_compare_ext_csds
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 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.
--- drivers/mmc/core/mmc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/mmc.c +2 -2
@@ -353,7 +353,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) } 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 = ext_csd[EXT_CSD_SEC_TRIM_MULT ]; card->ext_csd.raw_sec_erase_mult =
@@ -451,7 +451,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) goto out;/* 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]) && (card->ext_csd.raw_erased_mem_count == bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
Signature · 1 line
1.7.1
2012/2/1 Jurgen Heeks <[email protected]>:
Quoted 6 lines
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 Jurgen Heeks <[email protected]>---
Good catch! Looks good to me.
Thanks.
Hi,
Quoted 23 lines · Jurgen Heeks
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 Jurgen Heeks <[email protected]>--- drivers/mmc/core/mmc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/mmc/core/mmc.c +1
-1@@ -353,7 +353,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) } 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 = ext_csd[EXT_CSD_SEC_TRIM_MULT ]; card->ext_csd.raw_sec_erase_mult =
drivers/mmc/core/mmc.c static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) · line 457
Quoted 8 lines
drivers/mmc/core/mmc.c +1
-1@@ -451,7 +451,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) goto out;/* 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]) && (card->ext_csd.raw_erased_mem_count == bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
Thanks very much, Jurgen! Pushed to mmc-next for 3.3 with Namjae's Reviewed-by.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child