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

mmc: core: Mark fixups as __maybe_unused

Not all source files which include quirks.h make use of the all of
the available fixup information. When this happens the compiler
complains that some constant variables are defined by never used.
We can fix this by telling the compiler that this intentional by
simply marking them as __maybe_unused.

Fixes the following W=1 kernel build warnings:

In file included from drivers/mmc/core/sdio.c:22:
drivers/mmc/core/quirks.h:105:31: warning: ‘mmc_ext_csd_fixups’ defined but not used [-Wunused-const-variable=]
105 | static const struct mmc_fixup mmc_ext_csd_fixups[] = {
| ^~~~~~~~~~~~~~~~~~
drivers/mmc/core/quirks.h:17:31: warning: ‘mmc_blk_fixups’ defined but not used [-Wunused-const-variable=]
17 | static const struct mmc_fixup mmc_blk_fixups[] = {
| ^~~~~~~~~~~~~~
In file included from drivers/mmc/core/mmc.c:25:
drivers/mmc/core/quirks.h:123:31: warning: ‘sdio_fixup_methods’ defined but not used [-Wunused-const-variable=]
123 | static const struct mmc_fixup sdio_fixup_methods[] = {
| ^~~~~~~~~~~~~~~~~~
drivers/mmc/core/quirks.h:17:31: warning: ‘mmc_blk_fixups’ defined but not used [-Wunused-const-variable=]
17 | static const struct mmc_fixup mmc_blk_fixups[] = {
| ^~~~~~~~~~~~~~

Cc: Andrei Warkentin <andreiw@motorola.com>
Cc: Martin Mares <mj@ucw.cz>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200701124702.908713-2-lee.jones@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Lee Jones and committed by
Ulf Hansson
482cedd2 53e888d1

+3 -3
+3 -3
drivers/mmc/core/quirks.h
··· 14 14 15 15 #include "card.h" 16 16 17 - static const struct mmc_fixup mmc_blk_fixups[] = { 17 + static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = { 18 18 #define INAND_CMD38_ARG_EXT_CSD 113 19 19 #define INAND_CMD38_ARG_ERASE 0x00 20 20 #define INAND_CMD38_ARG_TRIM 0x01 ··· 102 102 END_FIXUP 103 103 }; 104 104 105 - static const struct mmc_fixup mmc_ext_csd_fixups[] = { 105 + static const struct mmc_fixup __maybe_unused mmc_ext_csd_fixups[] = { 106 106 /* 107 107 * Certain Hynix eMMC 4.41 cards might get broken when HPI feature 108 108 * is used so disable the HPI feature for such buggy cards. ··· 120 120 }; 121 121 122 122 123 - static const struct mmc_fixup sdio_fixup_methods[] = { 123 + static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = { 124 124 SDIO_FIXUP(SDIO_VENDOR_ID_TI_WL1251, SDIO_DEVICE_ID_TI_WL1251, 125 125 add_quirk, MMC_QUIRK_NONSTD_FUNC_IF), 126 126