Skip to content

Commit 55e0961

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: rename mmc_can_secure_erase_trim() to mmc_card_can_secure_erase_trim()
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 2abda04 commit 55e0961

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

drivers/mmc/core/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
12761276
int err = 0, type = MMC_BLK_SECDISCARD;
12771277
blk_status_t status = BLK_STS_OK;
12781278

1279-
if (!(mmc_can_secure_erase_trim(card))) {
1279+
if (!(mmc_card_can_secure_erase_trim(card))) {
12801280
status = BLK_STS_NOTSUPP;
12811281
goto out;
12821282
}

drivers/mmc/core/core.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,14 +1871,12 @@ bool mmc_card_can_sanitize(struct mmc_card *card)
18711871
return false;
18721872
}
18731873

1874-
int mmc_can_secure_erase_trim(struct mmc_card *card)
1874+
bool mmc_card_can_secure_erase_trim(struct mmc_card *card)
18751875
{
1876-
if ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) &&
1877-
!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
1878-
return 1;
1879-
return 0;
1876+
return ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) &&
1877+
!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN));
18801878
}
1881-
EXPORT_SYMBOL(mmc_can_secure_erase_trim);
1879+
EXPORT_SYMBOL(mmc_card_can_secure_erase_trim);
18821880

18831881
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from,
18841882
unsigned int nr)

drivers/mmc/core/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ 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);
124124
bool mmc_card_can_sanitize(struct mmc_card *card);
125-
int mmc_can_secure_erase_trim(struct mmc_card *card);
125+
bool mmc_card_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);
128128

drivers/mmc/core/queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void mmc_queue_setup_discard(struct mmc_card *card,
184184
return;
185185

186186
lim->max_hw_discard_sectors = max_discard;
187-
if (mmc_can_secure_erase_trim(card))
187+
if (mmc_card_can_secure_erase_trim(card))
188188
lim->max_secure_erase_sectors = max_discard;
189189
if (mmc_can_trim(card) && card->erased_byte == 0)
190190
lim->max_write_zeroes_sectors = max_discard;

0 commit comments

Comments
 (0)