Hello Arnd, On Tue, Feb 25, 2025 at 05:25:05PM +0100, Arnd Bergmann wrote: > On Tue, Feb 25, 2025, at 16:47, Uwe Kleine-König wrote: > > On Tue, Feb 25, 2025 at 03:53:26PM +0100, Arnd Bergmann wrote: > >> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/ > > > > With > > > > diff --git a/include/linux/module.h b/include/linux/module.h > > index 30e5b19bafa9..014f033ef1ba 100644 > > --- a/include/linux/module.h > > +++ b/include/linux/module.h > > @@ -250,7 +250,8 @@ extern void cleanup_module(void); > > extern typeof(name) __mod_device_table__##type##__##name \ > > __attribute__ ((unused, alias(__stringify(name)))) > > #else /* !MODULE */ > > -#define MODULE_DEVICE_TABLE(type, name) > > +#define MODULE_DEVICE_TABLE(type, name) \ > > +static const typeof(name) *__mod_device_table__##type##__##name##_ptr > > __attribute__((unused)) = &(name) > > #endif > > > > /* Version of form [<epoch>:]<version>[-<extra-version>]. Hu? > > the warning goes away and stmpe_ts_ids isn't included in the .o file > > without having to add __maybe_unused to the driver. > > > > I would consider that a superior approach. > > Not sure, I can see how this avoids some warnings, but this is > currently the only remaining instance of this problem (I fixed > another two recently), and in most cases a MODULE_DEVICE_TABLE() > entry that is completely unused ends up pointing to a real bug, > where there is a table but it's not also part of the > device_driver definition. It might be the only instance without __maybe_unused and so triggering a warning. But there is also: $ git grep -E 'of_device_id.*__maybe_unused' | wc -l 231 $ git grep -E 'mdio_device_id.*__maybe_unused' | wc -l 58 Best regards Uwe
Attachment:
signature.asc
Description: PGP signature