* [PATCH] mmc: core: remove redundant card null check to mmc_can_sleep()
@ 2021-01-15 3:45 Yue Hu
2021-01-15 12:21 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Yue Hu @ 2021-01-15 3:45 UTC (permalink / raw)
To: ulf.hansson; +Cc: linux-mmc, huyue2
From: Yue Hu <huyue2@yulong.com>
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 <huyue2@yulong.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: core: remove redundant card null check to mmc_can_sleep()
2021-01-15 3:45 [PATCH] mmc: core: remove redundant card null check to mmc_can_sleep() Yue Hu
@ 2021-01-15 12:21 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2021-01-15 12:21 UTC (permalink / raw)
To: Yue Hu; +Cc: linux-mmc@vger.kernel.org, Yue Hu
On Fri, 15 Jan 2021 at 04:46, Yue Hu <zbestahu@gmail.com> wrote:
>
> From: Yue Hu <huyue2@yulong.com>
>
> 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 <huyue2@yulong.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-15 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-15 3:45 [PATCH] mmc: core: remove redundant card null check to mmc_can_sleep() Yue Hu
2021-01-15 12:21 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox