Skip to contentSkip to conversation

MMC: ext_csd.raw_* used in comparison but never set

PATCH In review Andrei Warkentin 3 participants 3 messages Sep 23, 2011 – Sep 24, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MMC: ext_csd.raw_* used in comparison but never set

f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to only compare read-only ext_csd fields in bus width testing code, yet it's comparing some fields that are never set.

The affected fields are ext_csd.raw_erased_mem_count and ext_csd.raw_partition_support.

---
 drivers/mmc/core/mmc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/core/mmc.c +2 -0
index 5700b1c..bb33832 100644
@@ -359,6 +359,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		 * card has the Enhanced area enabled.  If so, export enhanced
 		 * area offset and size to user by adding sysfs interface.
 		 */
+		card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
 		if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
 		    (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
 			u8 hc_erase_grp_sz =
@@ -405,6 +406,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 	if (card->ext_csd.rev >= 5)
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 
+	card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
 	if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
 		card->erased_byte = 0xFF;
 	else
Signature · 1 line
1.7.6.1
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Andrei Warkentin

f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to only compare read-only ext_csd fields in bus width testing code, yet it's comparing some fields that are never set.

The affected fields are ext_csd.raw_erased_mem_count and ext_csd.raw_partition_support.

---
drivers/mmc/core/mmc.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/core/mmc.c +2 -0
index 5700b1c..bb33832 100644
@@ -359,6 +359,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		 * card has the Enhanced area enabled.  If so, export enhanced
 		 * area offset and size to user by adding sysfs interface.
 		 */
+		card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
 		if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
 		    (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
 			u8 hc_erase_grp_sz =
@@ -405,6 +406,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 	if (card->ext_csd.rev >= 5)
 		card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
 
+	card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
 	if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
 		card->erased_byte = 0xFF;
 	else
Signature · 1 line
1.7.6.1
#2 lore raw
In reply to Andrei Warkentin

Hi,

Quoted 9 lines · Andrei Warkentin

f39b2dd9d065151a04f5996656d1f27a7eb32d45 added code to only compare read-only ext_csd fields in bus width testing code, yet it's comparing some fields that are never set.

The affected fields are ext_csd.raw_erased_mem_count and ext_csd.raw_partition_support.

Thanks, pushed to mmc-next for 3.2 with a stable@ tag.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child