Skip to contentSkip to conversation

mmc: Remove dead code

PATCH In review Philippe De Swert 4 participants 5 messages Apr 11, 2012 – May 10, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 mmc: Remove dead code

bus_width is passed to the function and when 0 (MMC_BUS_WIDTH_1) will cause the function to return. So in in the second test it definitly is different from 0, and the third test is redundant.

---
 drivers/mmc/core/mmc.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mmc/core/mmc.c +1 -5
index 54df5ad..4a1bf8f 100644
@@ -556,14 +556,10 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
 	err = mmc_get_ext_csd(card, &bw_ext_csd);
 
 	if (err || bw_ext_csd == NULL) {
-		if (bus_width != MMC_BUS_WIDTH_1)
-			err = -EINVAL;
+		err = -EINVAL;
 		goto out;
 	}
 
-	if (bus_width == MMC_BUS_WIDTH_1)
-		goto out;
-
 	/* only compare read only fields */
 	err = !((card->ext_csd.raw_partition_support ==
 			bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
Signature · 1 line
1.7.9.5
Acked-by on v1 2/2
#1 lore raw
Quoted 32 lines · Philippe De Swert

bus_width is passed to the function and when 0 (MMC_BUS_WIDTH_1) will cause the function to return. So in in the second test it definitly is different from 0, and the third test is redundant.

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

1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mmc/core/mmc.c +1 -5
index 54df5ad..4a1bf8f 100644
@@ -556,14 +556,10 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
 	err = mmc_get_ext_csd(card, &bw_ext_csd);
 
 	if (err || bw_ext_csd == NULL) {
-		if (bus_width != MMC_BUS_WIDTH_1)
-			err = -EINVAL;
+		err = -EINVAL;
 		goto out;
 	}
 
-	if (bus_width == MMC_BUS_WIDTH_1)
-		goto out;
-
 	/* only compare read only fields */
 	err = !((card->ext_csd.raw_partition_support ==
 			bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
Signature · 1 line
1.7.9.5
#3 lore raw

Hi. Chris.

Would you check this patch also ?

Thanks.

2012/4/12, Namjae Jeon <[email protected]>:

Quoted 10 lines

2012/4/12 Philippe De Swert <[email protected]>:

Quoted 6 lines

bus_width is passed to the function and when 0 (MMC_BUS_WIDTH_1) will cause the function to return. So in in the second test it definitly is different from 0, and the third test is redundant.

---

Looks good to me.

#4 lore raw
In reply to Philippe De Swert

Hi,

Quoted 19 lines · Philippe De Swert

bus_width is passed to the function and when 0 (MMC_BUS_WIDTH_1) will cause the function to return. So in in the second test it definitly is different from 0, and the third test is redundant.

---
 drivers/mmc/core/mmc.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mmc/core/mmc.c +0 -2
index 54df5ad..4a1bf8f 100644
@@ -556,14 +556,10 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
 	err = mmc_get_ext_csd(card, &bw_ext_csd);
 
 	if (err || bw_ext_csd == NULL) {
-		if (bus_width != MMC_BUS_WIDTH_1)
-			err = -EINVAL;

drivers/mmc/core/mmc.c static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) · line 565

Quoted 10 lines
drivers/mmc/core/mmc.c +1 -3
+		err = -EINVAL;
 		goto out;
 	}
 
-	if (bus_width == MMC_BUS_WIDTH_1)
-		goto out;
-
 	/* only compare read only fields */
 	err = !((card->ext_csd.raw_partition_support ==
 			bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&

Thanks, pushed for mmc-next for 3.5.

- Chris.

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