Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250401095847.29271-8-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Wolfram Sang and committed by
Ulf Hansson
55e0961a 2abda048

+7 -9
+1 -1
drivers/mmc/core/block.c
··· 1276 1276 int err = 0, type = MMC_BLK_SECDISCARD; 1277 1277 blk_status_t status = BLK_STS_OK; 1278 1278 1279 - if (!(mmc_can_secure_erase_trim(card))) { 1279 + if (!(mmc_card_can_secure_erase_trim(card))) { 1280 1280 status = BLK_STS_NOTSUPP; 1281 1281 goto out; 1282 1282 }
+4 -6
drivers/mmc/core/core.c
··· 1871 1871 return false; 1872 1872 } 1873 1873 1874 - int mmc_can_secure_erase_trim(struct mmc_card *card) 1874 + bool mmc_card_can_secure_erase_trim(struct mmc_card *card) 1875 1875 { 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)); 1880 1878 } 1881 - EXPORT_SYMBOL(mmc_can_secure_erase_trim); 1879 + EXPORT_SYMBOL(mmc_card_can_secure_erase_trim); 1882 1880 1883 1881 int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, 1884 1882 unsigned int nr)
+1 -1
drivers/mmc/core/core.h
··· 122 122 int mmc_can_trim(struct mmc_card *card); 123 123 bool mmc_card_can_discard(struct mmc_card *card); 124 124 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); 126 126 int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr); 127 127 unsigned int mmc_calc_max_discard(struct mmc_card *card); 128 128
+1 -1
drivers/mmc/core/queue.c
··· 184 184 return; 185 185 186 186 lim->max_hw_discard_sectors = max_discard; 187 - if (mmc_can_secure_erase_trim(card)) 187 + if (mmc_card_can_secure_erase_trim(card)) 188 188 lim->max_secure_erase_sectors = max_discard; 189 189 if (mmc_can_trim(card) && card->erased_byte == 0) 190 190 lim->max_write_zeroes_sectors = max_discard;