From patchwork Fri May 19 09:32:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 96313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1103806vqo; Fri, 19 May 2023 02:38:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PYcRUnNEr2BASeHcUqdIinAS6V1ACmPW1FFIVVDf6qg0FPqM+5+1cuKTermlVlAwmoLhf X-Received: by 2002:a17:902:e889:b0:1ac:7245:ba55 with SMTP id w9-20020a170902e88900b001ac7245ba55mr5626728plg.6.1684489121857; Fri, 19 May 2023 02:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489121; cv=none; d=google.com; s=arc-20160816; b=MuT6AhVWkggZhE7eOip07sqtLLYLkhAqjcx4KqwgGa9eRMV+emJGx/gYwgRy4XaS9y T6g1xzmNZoUIv+XTdg57oYcbdNKbxLPXIWmdoOKHKfP5e5PXs44Zh41rKxTfsYcnNlU8 KBIkSuUkuLekZC0Pb5yp479GDjbppatbHET4kGG3Wwe4oBPGp9fF0Sc9jLaRo0rFbjIo DxU0eRdXcemMY6fyjBOe7qsOSZOq4mfBJN6U5Zs5CV+vJbPvJLIgUFGtkDstAVcGdTJC DTE0wS0sTxPWea3FCfuRQuval9Iwkgr1Sk+w0vY6yhRBMKjJjCiXG/ew+VJRCwuBI5Pv 1s2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BtktTK37zCSQ8VAqtKn5INz6adLKBQ2Q4xBF7yCW5d8=; b=sLbXdJVhXOC38nCzMx8DeUq5sQ7PiRyBLXzJwTGO0R5NEre6tYJHUDTLVFk9cMCY6z sBZIlCL08yr9nP9FBUfkXHuiLcTGgog4OUP6FzlRVFDxpLZKHwa79sjysOLy9NZ6B7h1 IqhfTXKGcHn2R6QO0lXiytJwO2V5MX3jS8AhgfVfa5oQlujkdel8bgTH2X1qQTsgW7O6 QkX+TP2Go2jtKFNtRZ4E5KH9tQiacbF4J/YCyhlewbLqOOC0gVMsAnA39fXrRgLkjWmK rY2+eEhh2AhU3nt2KhDmY7oqkip7jkmKH8PVdAe9x7qmURLIVJ/MRGoIb/gb1uob8i8C A37w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JRY03y+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170902b41400b001a8102f5d7fsi3102139plr.504.2023.05.19.02.38.29; Fri, 19 May 2023 02:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JRY03y+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231815AbjESJfr (ORCPT + 99 others); Fri, 19 May 2023 05:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjESJfc (ORCPT ); Fri, 19 May 2023 05:35:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7FF2127 for ; Fri, 19 May 2023 02:34:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80D85655A3 for ; Fri, 19 May 2023 09:32:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C46CC4339B; Fri, 19 May 2023 09:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684488775; bh=wGKJyQlBy4S9Q6vaML8h068iGf1xJ8aPt0xeOhV7lkE=; h=From:To:Cc:Subject:Date:From; b=JRY03y+kPjBs3+pNdyS3dr3enxOCHF/Z0w0g/El9B6THPmic1qZfEf4prdMnQvZ1f FAzsYoTYlrp/8mnOZWxzentNUkYVnEua00zRHrn+SOXtT5grVjeg0+zPRSS22sgzWU dkI123s6ZiRrtDFTtpCzigQXhDxIt7EkhFHJnvae5pXaizwrw7yz3kkah53g05FBlk TiPRZBSya8obTsXj1x+zcncI0dRS6J8zPkQk7rXr6HbcnGlmy/FY+P8pxHDwL3w/8N CL8N6ho1xLyobc/2WDp2XV7/H52BoxPk3/oomN6UOf0WT+YUZYMdV1MmecHFor0tVo c3d64YH4j96oQ== From: Arnd Bergmann 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@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [net-next] net: ipconfig: move ic_nameservers_fallback into #ifdef block Date: Fri, 19 May 2023 11:32:38 +0200 Message-Id: <20230519093250.4011881-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766314865703284062?= X-GMAIL-MSGID: =?utf-8?q?1766314865703284062?= From: Arnd Bergmann 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 Reviewed-by: Simon Horman --- 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. */