From: David Ahern <dsahern@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Kunwu Chan <chentao@kylinos.cn>,
Joel Granados <joel.granados@gmail.com>,
Zhengchao Shao <shaozhengchao@huawei.com>,
Wangyang Guo <wangyang.guo@intel.com>,
Kyle Zeng <zengyhkyle@gmail.com>,
Beniamino Galvani <b.galvani@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipv4/route: avoid unused-but-set-variable warning
Date: Fri, 22 Mar 2024 09:10:39 -0600 [thread overview]
Message-ID: <4f1aed2e-d382-4147-912a-c915026f8f0c@kernel.org> (raw)
In-Reply-To: <20240322131817.905700-1-arnd@kernel.org>
On 3/22/24 7:18 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The log_martians variable is only used in an #ifdef, causing a 'make W=1'
> warning with gcc:
>
> net/ipv4/route.c: In function 'ip_rt_send_redirect':
> net/ipv4/route.c:880:13: error: variable 'log_martians' set but not used [-Werror=unused-but-set-variable]
>
> Change the #ifdef to an equivalent IS_ENABLED() to let the compiler
> see where the variable is used.
>
> Fixes: 30038fc61adf ("net: ip_rt_send_redirect() optimization")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> net/ipv4/route.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
prev parent reply other threads:[~2024-03-22 15:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 13:18 [PATCH] ipv4/route: avoid unused-but-set-variable warning Arnd Bergmann
2024-03-22 13:26 ` Simon Horman
2024-03-22 15:10 ` David Ahern [this message]
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=4f1aed2e-d382-4147-912a-c915026f8f0c@kernel.org \
--to=dsahern@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=b.galvani@gmail.com \
--cc=chentao@kylinos.cn \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joel.granados@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shaozhengchao@huawei.com \
--cc=wangyang.guo@intel.com \
--cc=zengyhkyle@gmail.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