Commit 55e0961a authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250401095847.29271-8-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 2abda048
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1276,7 +1276,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
	int err = 0, type = MMC_BLK_SECDISCARD;
	blk_status_t status = BLK_STS_OK;

	if (!(mmc_can_secure_erase_trim(card))) {
	if (!(mmc_card_can_secure_erase_trim(card))) {
		status = BLK_STS_NOTSUPP;
		goto out;
	}
+4 −6
Original line number Diff line number Diff line
@@ -1871,14 +1871,12 @@ bool mmc_card_can_sanitize(struct mmc_card *card)
	return false;
}

int mmc_can_secure_erase_trim(struct mmc_card *card)
bool mmc_card_can_secure_erase_trim(struct mmc_card *card)
{
	if ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) &&
	    !(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
		return 1;
	return 0;
	return ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) &&
		!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN));
}
EXPORT_SYMBOL(mmc_can_secure_erase_trim);
EXPORT_SYMBOL(mmc_card_can_secure_erase_trim);

int mmc_erase_group_aligned(struct mmc_card *card, sector_t from,
			    unsigned int nr)
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ bool mmc_card_can_erase(struct mmc_card *card);
int mmc_can_trim(struct mmc_card *card);
bool mmc_card_can_discard(struct mmc_card *card);
bool mmc_card_can_sanitize(struct mmc_card *card);
int mmc_can_secure_erase_trim(struct mmc_card *card);
bool mmc_card_can_secure_erase_trim(struct mmc_card *card);
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr);
unsigned int mmc_calc_max_discard(struct mmc_card *card);

+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ static void mmc_queue_setup_discard(struct mmc_card *card,
		return;

	lim->max_hw_discard_sectors = max_discard;
	if (mmc_can_secure_erase_trim(card))
	if (mmc_card_can_secure_erase_trim(card))
		lim->max_secure_erase_sectors = max_discard;
	if (mmc_can_trim(card) && card->erased_byte == 0)
		lim->max_write_zeroes_sectors = max_discard;