From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jijie Shao" <shaojijie@huawei.com>,
"Arnd Bergmann" <arnd@kernel.org>,
"Jian Shen" <shenjian15@huawei.com>,
"Salil Mehta" <salil.mehta@huawei.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>
Cc: "Simon Horman" <horms@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
Netdev <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: hisilicon: hns_mdio: remove incorrect ACPI_PTR annotation
Date: Wed, 26 Feb 2025 07:49:33 +0100 [thread overview]
Message-ID: <c0a3d083-d6ae-491e-804d-28e4c37949d7@app.fastmail.com> (raw)
In-Reply-To: <da799a9f-f0c7-4ee0-994b-4f5a6992e93b@huawei.com>
On Wed, Feb 26, 2025, at 04:21, Jijie Shao wrote:
> on 2025/2/26 0:33, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Building with W=1 shows a warning about hns_mdio_acpi_match being unused when
>> CONFIG_ACPI is disabled:
>>
>> drivers/net/ethernet/hisilicon/hns_mdio.c:631:36: error: unused variable 'hns_mdio_acpi_match' [-Werror,-Wunused-const-variable]
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> drivers/net/ethernet/hisilicon/hns_mdio.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
>> index a1aa6c1f966e..6812be8dc64f 100644
>> --- a/drivers/net/ethernet/hisilicon/hns_mdio.c
>> +++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
>> @@ -640,7 +640,7 @@ static struct platform_driver hns_mdio_driver = {
>> .driver = {
>> .name = MDIO_DRV_NAME,
>> .of_match_table = hns_mdio_match,
>> - .acpi_match_table = ACPI_PTR(hns_mdio_acpi_match),
>> + .acpi_match_table = hns_mdio_acpi_match,
>> },
>> };
>
>
> But I think it can be changed to:
>
> + #ifdef CONFIG_ACPI
> static const struct acpi_device_id hns_mdio_acpi_match[] = {
> { "HISI0141", 0 },
> { },
> };
> MODULE_DEVICE_TABLE(acpi, hns_mdio_acpi_match);
> + #endif
>
That would of course avoid the build warning, but otherwise
would be worse: the only reason ACPI_PTR()/of_match_ptr() exist
is to work around drivers that have to put their device ID
table inside of an #ifdef for some other reason. Adding the
#ifdef to work around an incorrect ACPI_PTR() makes no sense.
Arnd
next prev parent reply other threads:[~2025-02-26 6:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 16:33 Arnd Bergmann
2025-02-25 16:33 ` [PATCH 2/2] net: xgene-v2: " Arnd Bergmann
2025-02-26 3:21 ` [PATCH 1/2] net: hisilicon: hns_mdio: " Jijie Shao
2025-02-26 6:49 ` Arnd Bergmann [this message]
2025-02-27 11:53 ` Jijie Shao
2025-02-27 12:03 ` Arnd Bergmann
2025-02-27 12:41 ` Paolo Abeni
2025-02-27 12:50 ` patchwork-bot+netdevbpf
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=c0a3d083-d6ae-491e-804d-28e4c37949d7@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=u.kleine-koenig@baylibre.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®