Skip to content

Commit 2abda04

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: rename mmc_can_sanitize() to mmc_card_can_sanitize()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 07dd2b3 commit 2abda04

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/mmc/core/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,13 +1862,13 @@ bool mmc_card_can_discard(struct mmc_card *card)
18621862
}
18631863
EXPORT_SYMBOL(mmc_card_can_discard);
18641864

1865-
int mmc_can_sanitize(struct mmc_card *card)
1865+
bool mmc_card_can_sanitize(struct mmc_card *card)
18661866
{
18671867
if (!mmc_can_trim(card) && !mmc_card_can_erase(card))
1868-
return 0;
1868+
return false;
18691869
if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE)
1870-
return 1;
1871-
return 0;
1870+
return true;
1871+
return false;
18721872
}
18731873

18741874
int mmc_can_secure_erase_trim(struct mmc_card *card)

drivers/mmc/core/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ int mmc_erase(struct mmc_card *card, sector_t from, unsigned int nr, unsigned in
121121
bool mmc_card_can_erase(struct mmc_card *card);
122122
int mmc_can_trim(struct mmc_card *card);
123123
bool mmc_card_can_discard(struct mmc_card *card);
124-
int mmc_can_sanitize(struct mmc_card *card);
124+
bool mmc_card_can_sanitize(struct mmc_card *card);
125125
int mmc_can_secure_erase_trim(struct mmc_card *card);
126126
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr);
127127
unsigned int mmc_calc_max_discard(struct mmc_card *card);

drivers/mmc/core/mmc_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ int mmc_sanitize(struct mmc_card *card, unsigned int timeout_ms)
10461046
struct mmc_host *host = card->host;
10471047
int err;
10481048

1049-
if (!mmc_can_sanitize(card)) {
1049+
if (!mmc_card_can_sanitize(card)) {
10501050
pr_warn("%s: Sanitize not supported\n", mmc_hostname(host));
10511051
return -EOPNOTSUPP;
10521052
}

0 commit comments

Comments
 (0)