Re: [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables
From: Krzysztof Kozlowski
Date: Tue Jul 07 2026 - 13:29:23 EST
On 03/07/2026 17:46, Uwe Kleine-König (The Capable Hub) wrote:
> Referencing these arrays in MODULE_DEVICE_TABLE() is enough to convince
> the compiler that they are used even if the drivers are built-in (since
> 5ab23c7923a1 ("modpost: Create modalias for builtin modules"). So the
> __maybe_unused marking can be removed without introducing a compiler
> warning.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
> ---
> drivers/nfc/nfcmrvl/i2c.c | 2 +-
> drivers/nfc/nfcmrvl/spi.c | 2 +-
> drivers/nfc/pn533/i2c.c | 2 +-
> drivers/nfc/pn544/i2c.c | 2 +-
> drivers/nfc/s3fwrn5/i2c.c | 2 +-
> drivers/nfc/st-nci/i2c.c | 2 +-
> drivers/nfc/st-nci/spi.c | 2 +-
> drivers/nfc/st21nfca/i2c.c | 2 +-
> drivers/nfc/st95hf/core.c | 2 +-
> drivers/nfc/trf7970a.c | 2 +-
> 10 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
> index 66877a7d03f2..687d2979b881 100644
> --- a/drivers/nfc/nfcmrvl/i2c.c
> +++ b/drivers/nfc/nfcmrvl/i2c.c
> @@ -245,7 +245,7 @@ static void nfcmrvl_i2c_remove(struct i2c_client *client)
> }
>
>
> -static const struct of_device_id of_nfcmrvl_i2c_match[] __maybe_unused = {
> +static const struct of_device_id of_nfcmrvl_i2c_match[] = {
> { .compatible = "marvell,nfc-i2c", },
> {},
This (and probably others) should re-introduce warnings on !MODULE and
!OF builds (and other cases).
Best regards,
Krzysztof