Skip to contentSkip to conversation

mmc: core: bus.c: removed unnecessary NULL check for kfree(...)

PATCH In review Sangho Yi 2 participants 3 messages Oct 19, 2012 MMC, SD and SDIO

lore
Share & tools
lore

Sangho Yi

author
#0 lore raw

PATCH 1/2 mmc: core: bus.c: removed unnecessary NULL check for kfree(...)

kfree(NULL) is safe so I removed the if statements for NULL check.

---
 drivers/mmc/core/bus.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/core/bus.c +1 -2
index 9b68933..420cb67 100644
@@ -225,8 +225,7 @@ static void mmc_release_card(struct device *dev)
 
 	sdio_free_common_cis(card);
 
-	if (card->info)
-		kfree(card->info);
+	kfree(card->info);
 
 	kfree(card);
 }
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/2 mmc: core: bus.c: re-aligned the line over 80 chars

I made a correction on a line which has > 80 characters also, aligned the consecutive line to meet the --strict rule.

---
 drivers/mmc/core/bus.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/bus.c +2 -2
index 420cb67..66bac9f 100644
@@ -269,8 +269,8 @@ int mmc_add_card(struct mmc_card *card)
 		[UHS_DDR50_BUS_SPEED] = "DDR50 ",
 	};
 
-
-	dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);
+	dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host),
+		     card->rca);
 
 	switch (card->type) {
 	case MMC_TYPE_MMC:
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/2
#2 lore raw
In reply to Sangho Yi
Quoted 23 lines · Sangho Yi

kfree(NULL) is safe so I removed the if statements for NULL check.

---
drivers/mmc/core/bus.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/core/bus.c +1 -2
index 9b68933..420cb67 100644
@@ -225,8 +225,7 @@ static void mmc_release_card(struct device *dev)
 
 	sdio_free_common_cis(card);
 
-	if (card->info)
-		kfree(card->info);
+	kfree(card->info);
 
 	kfree(card);
 }
Signature · 1 line
1.7.9.5
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html