Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Subject: [RFC PATCH 01/11] mmc: rename mmc_can_discard() to mmc_card_can_discard()
Date: Tue,  1 Apr 2025 11:58:37 +0200	[thread overview]
Message-ID: <20250401095847.29271-2-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20250401095847.29271-1-wsa+renesas@sang-engineering.com>

mmc_can_* functions sometimes relate to the card and sometimes to the host.
Make it obvious by renaming this function to include 'card'. Also, convert to
proper bool type while we are here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/core/core.c | 8 +++-----
 drivers/mmc/core/core.h | 2 +-
 drivers/mmc/core/mmc.c  | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index ce08e0ea7fc1..8bc46ea370e8 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1854,17 +1854,15 @@ int mmc_can_trim(struct mmc_card *card)
 }
 EXPORT_SYMBOL(mmc_can_trim);
 
-int mmc_can_discard(struct mmc_card *card)
+bool mmc_card_can_discard(struct mmc_card *card)
 {
 	/*
 	 * As there's no way to detect the discard support bit at v4.5
 	 * use the s/w feature support filed.
 	 */
-	if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE)
-		return 1;
-	return 0;
+	return (card->ext_csd.feature_support & MMC_DISCARD_FEATURE);
 }
-EXPORT_SYMBOL(mmc_can_discard);
+EXPORT_SYMBOL(mmc_card_can_discard);
 
 int mmc_can_sanitize(struct mmc_card *card)
 {
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index fc9c066e6468..e88b64379ab0 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -120,7 +120,7 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq);
 int mmc_erase(struct mmc_card *card, sector_t from, unsigned int nr, unsigned int arg);
 int mmc_can_erase(struct mmc_card *card);
 int mmc_can_trim(struct mmc_card *card);
-int mmc_can_discard(struct mmc_card *card);
+bool mmc_card_can_discard(struct mmc_card *card);
 int mmc_can_sanitize(struct mmc_card *card);
 int mmc_can_secure_erase_trim(struct mmc_card *card);
 int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index df5de69b981b..0bcad3ec8c83 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1804,7 +1804,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	}
 
 	/* set erase_arg */
-	if (mmc_can_discard(card))
+	if (mmc_card_can_discard(card))
 		card->erase_arg = MMC_DISCARD_ARG;
 	else if (mmc_can_trim(card))
 		card->erase_arg = MMC_TRIM_ARG;
-- 
2.47.2


  reply	other threads:[~2025-04-01  9:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  9:58 [RFC PATCH 00/11] mmc: rename mmc_can_* functions Wolfram Sang
2025-04-01  9:58 ` Wolfram Sang [this message]
2025-04-01  9:58 ` [RFC PATCH 02/11] mmc: rename mmc_can_erase() to mmc_card_can_erase() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 03/11] mmc: rename mmc_can_ext_csd() to mmc_card_can_ext_csd() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 04/11] mmc: rename mmc_can_poweroff_notify() to mmc_card_can_poweroff_notify() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 05/11] mmc: rename mmc_can_reset() to mmc_card_can_reset() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 06/11] mmc: rename mmc_can_sanitize() to mmc_card_can_sanitize() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 07/11] mmc: rename mmc_can_secure_erase_trim() to mmc_card_can_secure_erase_trim() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 08/11] mmc: rename mmc_can_sleep() to mmc_card_can_sleep() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 09/11] mmc: rename mmc_can_trim() to mmc_card_can_trim() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 10/11] mmc: rename mmc_can_gpio_cd() to mmc_host_can_gpio_cd() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 11/11] mmc: rename mmc_can_gpio_ro() to mmc_host_can_gpio_ro() Wolfram Sang
2025-04-22 15:43 ` [RFC PATCH 00/11] mmc: rename mmc_can_* functions Ulf Hansson
2025-04-22 15:59   ` Wolfram Sang
2025-04-23 20:29   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250401095847.29271-2-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox