From: Simon Horman <horms@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
leit@meta.com, kernel test robot <lkp@intel.com>,
Johannes Berg <johannes.berg@intel.com>,
Jamie Bainbridge <jamie.bainbridge@gmail.com>,
"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: dqs: Do not use extern for unused dql_group
Date: Mon, 2 Sep 2024 20:02:26 +0100 [thread overview]
Message-ID: <20240902190226.GL23170@kernel.org> (raw)
In-Reply-To: <20240902101734.3260455-1-leitao@debian.org>
On Mon, Sep 02, 2024 at 03:17:30AM -0700, Breno Leitao wrote:
> When CONFIG_DQL is not enabled, dql_group should be treated as a dead
> declaration. However, its current extern declaration assumes the linker
> will ignore it, which is generally true across most compiler and
> architecture combinations.
>
> But in certain cases, the linker still attempts to resolve the extern
> struct, even when the associated code is dead, resulting in a linking
> error. For instance the following error in loongarch64:
>
> >> loongarch64-linux-ld: net-sysfs.c:(.text+0x589c): undefined reference to `dql_group'
>
> Modify the declaration of the dead object to be an empty declaration
> instead of an extern. This change will prevent the linker from
> attempting to resolve an undefined reference.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409012047.eCaOdfQJ-lkp@intel.com/
> Fixes: 74293ea1c4db ("net: sysfs: Do not create sysfs for non BQL device")
> Signed-off-by: Breno Leitao <leitao@debian.org>
Thanks,
I see this with gcc-13.2.0 but, curiously, not 14.2.0.
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
next prev parent reply other threads:[~2024-09-02 19:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 10:17 [PATCH net] net: dqs: Do not use extern for unused dql_group Breno Leitao
2024-09-02 19:02 ` Simon Horman [this message]
2024-09-03 20:10 ` 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=20240902190226.GL23170@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jamie.bainbridge@gmail.com \
--cc=johannes.berg@intel.com \
--cc=kuba@kernel.org \
--cc=leit@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).