Skip to contentSkip to conversation

mmc: core: remove redundant card null check to mmc_can_sleep()

PATCH In review Yue Hu 2 participants 2 messages Jan 15, 2021 MMC, SD and SDIO

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 mmc: core: remove redundant card null check to mmc_can_sleep()

From: Yue Hu <[email protected]>

Note that only _mmc_suspend() will call mmc_can_sleep(). And card is checked before in mmc_can_poweroff_notify().

---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
index ff3063c..49e5487 100644
@@ -1899,7 +1899,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 
 static int mmc_can_sleep(struct mmc_card *card)
 {
-	return (card && card->ext_csd.rev >= 3);
+	return card->ext_csd.rev >= 3;
 }
 
 static int mmc_sleep(struct mmc_host *host)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Yue Hu

From: Yue Hu <[email protected]>

Note that only _mmc_suspend() will call mmc_can_sleep(). And card is checked before in mmc_can_poweroff_notify().

Applied for next, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -2
index ff3063c..49e5487 100644
@@ -1899,7 +1899,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 
 static int mmc_can_sleep(struct mmc_card *card)
 {
-       return (card && card->ext_csd.rev >= 3);
+       return card->ext_csd.rev >= 3;
 }
 
 static int mmc_sleep(struct mmc_host *host)
--

1.9.1