Re: [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables
Uwe Kleine-König (The Capable Hub) <[email protected]> Wed, 8 Jul 2026 07:05:23 +0200
| Newsgroups | dev.linux.lists.oe-linux-nfc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless |
|---|---|
| Message-ID | <ak3YSbzhmHi75INN@monoceros> |
--khemwuvx25deahm2
Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id
tables
MIME-Version: 1.0
On Tue, Jul 07, 2026 at 07:28:57PM +0200, Krzysztof Kozlowski wrote:
> On 03/07/2026 17:46, Uwe Kleine-K=F6nig (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.
> >=20
> > Signed-off-by: Uwe Kleine-K=F6nig (The Capable Hub) <u.kleine-koenig@ba=
ylibre.com>
> > ---
> > 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(-)
> >=20
> > 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 *c=
lient)
> > }
> > =20
> > =20
> > -static const struct of_device_id of_nfcmrvl_i2c_match[] __maybe_unused=
=3D {
> > +static const struct of_device_id of_nfcmrvl_i2c_match[] =3D {
> > { .compatible =3D "marvell,nfc-i2c", },
> > {},
>=20
> This (and probably others) should re-introduce warnings on !MODULE and
> !OF builds (and other cases).
With an x86_64 allnoconfig and just the things enabled to make this
driver build (i.e. I2C and a few NFC related switches, but neither OF
nor MODULES) the driver builds fine even with W=3D1. If I drop
MODULE_DEVICE_TABLE() the warning appears. So unless proven otherwise I
claim the commit log and the patch are correct.
Best regards
Uwe
--khemwuvx25deahm2
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmpN2pEACgkQj4D7WH0S
/k6Lzwf8DSkcD2KNkgrjPQ9dJBBjqHuxUaPDXFNacjjVAgwT6Pwfd+C7HF0KG1bs
BqtoTI9+PXKyjz2yPy6tJFV8pq6GqGUAaDrtvBxhkUd9h4nK3BFWFlO7Z1HyiTgs
syyZLelwtqqHOw74m5y5p2LDyRQj4VwwaFs1HxReBCEuCuVanb28I1/wONclUzMB
+3lIl+0yVrDpvO3PknOzLV5gQo39ZyjaJr61mUr/ef2o5QxGvNE1MI1H/qaseYKI
P0F0uWcnw/aUZxb2XL9+g8DFcSWUsBfx/zqKCivAMmnkgiyGS0GkzEE99yJ5sged
CfYwRmwSUEwwsfH+5kQUm0TAa7CkaQ==
=Jkjp
-----END PGP SIGNATURE-----
--khemwuvx25deahm2--