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_discard() to mmc_card_can_discard()

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-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Wolfram Sang and committed by
Ulf Hansson
76d62cde 7ea500bc

+5 -7
+3 -5
drivers/mmc/core/core.c
··· 1854 1854 } 1855 1855 EXPORT_SYMBOL(mmc_can_trim); 1856 1856 1857 - int mmc_can_discard(struct mmc_card *card) 1857 + bool mmc_card_can_discard(struct mmc_card *card) 1858 1858 { 1859 1859 /* 1860 1860 * As there's no way to detect the discard support bit at v4.5 1861 1861 * use the s/w feature support filed. 1862 1862 */ 1863 - if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE) 1864 - return 1; 1865 - return 0; 1863 + return (card->ext_csd.feature_support & MMC_DISCARD_FEATURE); 1866 1864 } 1867 - EXPORT_SYMBOL(mmc_can_discard); 1865 + EXPORT_SYMBOL(mmc_card_can_discard); 1868 1866 1869 1867 int mmc_can_sanitize(struct mmc_card *card) 1870 1868 {
+1 -1
drivers/mmc/core/core.h
··· 120 120 int mmc_erase(struct mmc_card *card, sector_t from, unsigned int nr, unsigned int arg); 121 121 int mmc_can_erase(struct mmc_card *card); 122 122 int mmc_can_trim(struct mmc_card *card); 123 - int mmc_can_discard(struct mmc_card *card); 123 + bool mmc_card_can_discard(struct mmc_card *card); 124 124 int mmc_can_sanitize(struct mmc_card *card); 125 125 int mmc_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);
+1 -1
drivers/mmc/core/mmc.c
··· 1804 1804 } 1805 1805 1806 1806 /* set erase_arg */ 1807 - if (mmc_can_discard(card)) 1807 + if (mmc_card_can_discard(card)) 1808 1808 card->erase_arg = MMC_DISCARD_ARG; 1809 1809 else if (mmc_can_trim(card)) 1810 1810 card->erase_arg = MMC_TRIM_ARG;