From: "Arnd Bergmann" <arnd@arndb.de>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Arnd Bergmann" <arnd@kernel.org>
Cc: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
"Yu Jiaoliang" <yujiaoliang@vivo.com>,
"Oliver Graute" <oliver.graute@kococonnector.com>,
linux-input@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] Input: stmpe-ts - mark OF related data as maybe unused
Date: Tue, 25 Feb 2025 17:25:05 +0100 [thread overview]
Message-ID: <a6d10d80-79d3-426f-9dc8-0ddab77e89d9@app.fastmail.com> (raw)
In-Reply-To: <6xoycaft6wnd4sm74f2o4koc7lvyl2mtxp2kc6lc4dzpjvby53@ejm5ssbfzbph>
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
next prev parent reply other threads:[~2025-02-25 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 14:53 Arnd Bergmann
2025-02-25 15:47 ` Uwe Kleine-König
2025-02-25 16:25 ` Arnd Bergmann [this message]
2025-02-25 20:17 ` Uwe Kleine-König
2025-02-25 21:27 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6d10d80-79d3-426f-9dc8-0ddab77e89d9@app.fastmail.com \
--to=arnd@arndb.de \
--cc=alexandre.torgue@foss.st.com \
--cc=arnd@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=oliver.graute@kococonnector.com \
--cc=u.kleine-koenig@baylibre.com \
--cc=yujiaoliang@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®