[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a6d10d80-79d3-426f-9dc8-0ddab77e89d9@app.fastmail.com>
Date: Tue, 25 Feb 2025 17:25:05 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
"Maxime Coquelin" <mcoquelin.stm32@...il.com>,
"Alexandre Torgue" <alexandre.torgue@...s.st.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@...aro.org>,
"Yu Jiaoliang" <yujiaoliang@...o.com>,
"Oliver Graute" <oliver.graute@...oconnector.com>,
linux-input@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] Input: stmpe-ts - mark OF related data as maybe unused
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>].
>
> 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.
Arnd
Powered by blists - more mailing lists