netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block
@ 2023-05-19  9:32 Arnd Bergmann
  2023-05-19 13:06 ` Simon Horman
  2023-05-22 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-05-19  9:32 UTC (permalink / raw)
  To: David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Martin Wetterwald
  Cc: Arnd Bergmann, XueBing Chen, Greg Kroah-Hartman, Saravana Kannan,
	netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The new variable is only used when IPCONFIG_BOOTP is defined and otherwise
causes a warning:

net/ipv4/ipconfig.c:177:12: error: 'ic_nameservers_fallback' defined but not used [-Werror=unused-variable]

Move it next to the user.

Fixes: 81ac2722fa19 ("net: ipconfig: Allow DNS to be overwritten by DHCPACK")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/ipv4/ipconfig.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 202fa1943ccd..c56b6fe6f0d7 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -173,9 +173,6 @@ static int ic_proto_have_if __initdata;
 /* MTU for boot device */
 static int ic_dev_mtu __initdata;
 
-/* DHCPACK can overwrite DNS if fallback was set upon first BOOTP reply */
-static int ic_nameservers_fallback __initdata;
-
 #ifdef IPCONFIG_DYNAMIC
 static DEFINE_SPINLOCK(ic_recv_lock);
 static volatile int ic_got_reply __initdata;    /* Proto(s) that replied */
@@ -668,6 +665,9 @@ static struct packet_type bootp_packet_type __initdata = {
 	.func =	ic_bootp_recv,
 };
 
+/* DHCPACK can overwrite DNS if fallback was set upon first BOOTP reply */
+static int ic_nameservers_fallback __initdata;
+
 /*
  *  Initialize DHCP/BOOTP extension fields in the request.
  */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block
  2023-05-19  9:32 [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block Arnd Bergmann
@ 2023-05-19 13:06 ` Simon Horman
  2023-05-22 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-05-19 13:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Martin Wetterwald, Arnd Bergmann, XueBing Chen,
	Greg Kroah-Hartman, Saravana Kannan, netdev, linux-kernel

On Fri, May 19, 2023 at 11:32:38AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The new variable is only used when IPCONFIG_BOOTP is defined and otherwise
> causes a warning:
> 
> net/ipv4/ipconfig.c:177:12: error: 'ic_nameservers_fallback' defined but not used [-Werror=unused-variable]
> 
> Move it next to the user.
> 
> Fixes: 81ac2722fa19 ("net: ipconfig: Allow DNS to be overwritten by DHCPACK")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks Arnd,

I was able to observe this too.

Reviewed-by: Simon Horman <simon.horman@corigine.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block
  2023-05-19  9:32 [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block Arnd Bergmann
  2023-05-19 13:06 ` Simon Horman
@ 2023-05-22 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-22 10:20 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: davem, dsahern, edumazet, kuba, pabeni, martin, arnd, chenxuebing,
	gregkh, saravanak, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 19 May 2023 11:32:38 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The new variable is only used when IPCONFIG_BOOTP is defined and otherwise
> causes a warning:
> 
> net/ipv4/ipconfig.c:177:12: error: 'ic_nameservers_fallback' defined but not used [-Werror=unused-variable]
> 
> [...]

Here is the summary with links:
  - [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block
    https://git.kernel.org/netdev/net-next/c/dbb99d78522a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-22 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19  9:32 [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block Arnd Bergmann
2023-05-19 13:06 ` Simon Horman
2023-05-22 10:20 ` patchwork-bot+netdevbpf

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).