Thread (2 messages) 2 messages, 2 authors, 2021-01-15
STALE2000d LANDED

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

From: Yue Hu <zbestahu@gmail.com>
Date: 2021-01-15 03:47:07
Subsystem: multimedia card (mmc), secure digital (sd) and sdio subsystem, the rest · Maintainers: Ulf Hansson, Linus Torvalds

From: Yue Hu <redacted>

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

Signed-off-by: Yue Hu <redacted>
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index ff3063c..49e5487 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help