Received: by 10.223.185.116 with SMTP id b49csp1122802wrg; Fri, 23 Feb 2018 12:19:25 -0800 (PST) X-Google-Smtp-Source: AH8x227KlyQELlHHZA8HQ3YfHtbglEDCZs9P+4ZkAvSZwU0ppKuvzut8LqWchAXsDudNh0x5DsSE X-Received: by 10.101.71.202 with SMTP id f10mr2282745pgs.91.1519417165704; Fri, 23 Feb 2018 12:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417165; cv=none; d=google.com; s=arc-20160816; b=OVyqqOt4Vodss3F76vdSaEoWvYaJGzPHVqgkaBO/6tc6VBvuy6nLdDjMjmkVhn3T9a v7+ozc/0aFn1KNPOuPws5Ab/ykHEtQjT98F++enXa6dPJoYHHgT7djvFEwLFos73Q9YJ dYG6szhU5WJrYSh1KMIstfUKo8eo4xM7kln9rC3sBx8p12jC3EN6JtDV6roqcsaSO5oT HCYepG/esi4q/3NsBdxzUlm/SWPl4yUYZ3VMGX20xG6/vW7qHtifcTT20CxCEoK1sCXC tQS+2Sq4umq4A5Sq/j1xIn4CaPoUvB66KIpzExPa0ST1yIMC+kJE9CGFUAI2rbUA8j/Q /gPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=F2+rUK4/RQcO288w6M+h8Nm7PA4QApaQEwx3N7bk7pI=; b=FncthMdQFoHCisDb4ak30hfO4fVxi1DA1/PypZW0zrRCsn1o3F0rqKFMmwBBx93ycJ SrRIKb40pJgRS16u5KLUbMTU3/Wsv5LQ8xm2tv94hvpPPhHKYt3k0b9SUtr7gJ7cg0TR Om/rQtM9gy+uhPMfB2bYUQDj5Lw3/NLWvjba5o/ZWfGw2pZ+sgdBmBikp4kUS85OwaSq ItJRccFqF9zuDGoJYDKd80Rt53CZRaKCAHv20c7dna2DoyPxmA4SltIIbx78kzsb5R89 K1vUjbyub0t7cbYfgmtFrvwg056I3qeJsGFR2eph4nLUNJ8YS1sbXDACqrem6p33919w UBCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si1881650pgq.109.2018.02.23.12.19.11; Fri, 23 Feb 2018 12:19:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755158AbeBWUSK (ORCPT + 99 others); Fri, 23 Feb 2018 15:18:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39860 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932521AbeBWSjz (ORCPT ); Fri, 23 Feb 2018 13:39:55 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1D2551182; Fri, 23 Feb 2018 18:39:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Julian Anastasov , Simon Horman Subject: [PATCH 4.4 117/193] netfilter: ipvs: avoid unused variable warnings Date: Fri, 23 Feb 2018 19:25:50 +0100 Message-Id: <20180223170344.173025093@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit f6ca9f46f6615c3a87529550058d1b468c0cad89 upstream. The proc_create() and remove_proc_entry() functions do not reference their arguments when CONFIG_PROC_FS is disabled, so we get a couple of warnings about unused variables in IPVS: ipvs/ip_vs_app.c:608:14: warning: unused variable 'net' [-Wunused-variable] ipvs/ip_vs_ctl.c:3950:14: warning: unused variable 'net' [-Wunused-variable] ipvs/ip_vs_ctl.c:3994:14: warning: unused variable 'net' [-Wunused-variable] This removes the local variables and instead looks them up separately for each use, which obviously avoids the warning. Signed-off-by: Arnd Bergmann Fixes: 4c50a8ce2b63 ("netfilter: ipvs: avoid unused variable warning") Acked-by: Julian Anastasov Signed-off-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipvs/ip_vs_app.c | 8 ++------ net/netfilter/ipvs/ip_vs_ctl.c | 15 ++++++--------- 2 files changed, 8 insertions(+), 15 deletions(-) --- a/net/netfilter/ipvs/ip_vs_app.c +++ b/net/netfilter/ipvs/ip_vs_app.c @@ -605,17 +605,13 @@ static const struct file_operations ip_v int __net_init ip_vs_app_net_init(struct netns_ipvs *ipvs) { - struct net *net = ipvs->net; - INIT_LIST_HEAD(&ipvs->app_list); - proc_create("ip_vs_app", 0, net->proc_net, &ip_vs_app_fops); + proc_create("ip_vs_app", 0, ipvs->net->proc_net, &ip_vs_app_fops); return 0; } void __net_exit ip_vs_app_net_cleanup(struct netns_ipvs *ipvs) { - struct net *net = ipvs->net; - unregister_ip_vs_app(ipvs, NULL /* all */); - remove_proc_entry("ip_vs_app", net->proc_net); + remove_proc_entry("ip_vs_app", ipvs->net->proc_net); } --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -3951,7 +3951,6 @@ static struct notifier_block ip_vs_dst_n int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) { - struct net *net = ipvs->net; int i, idx; /* Initialize rs_table */ @@ -3978,9 +3977,9 @@ int __net_init ip_vs_control_net_init(st spin_lock_init(&ipvs->tot_stats.lock); - proc_create("ip_vs", 0, net->proc_net, &ip_vs_info_fops); - proc_create("ip_vs_stats", 0, net->proc_net, &ip_vs_stats_fops); - proc_create("ip_vs_stats_percpu", 0, net->proc_net, + proc_create("ip_vs", 0, ipvs->net->proc_net, &ip_vs_info_fops); + proc_create("ip_vs_stats", 0, ipvs->net->proc_net, &ip_vs_stats_fops); + proc_create("ip_vs_stats_percpu", 0, ipvs->net->proc_net, &ip_vs_stats_percpu_fops); if (ip_vs_control_net_init_sysctl(ipvs)) @@ -3995,13 +3994,11 @@ err: void __net_exit ip_vs_control_net_cleanup(struct netns_ipvs *ipvs) { - struct net *net = ipvs->net; - ip_vs_trash_cleanup(ipvs); ip_vs_control_net_cleanup_sysctl(ipvs); - remove_proc_entry("ip_vs_stats_percpu", net->proc_net); - remove_proc_entry("ip_vs_stats", net->proc_net); - remove_proc_entry("ip_vs", net->proc_net); + remove_proc_entry("ip_vs_stats_percpu", ipvs->net->proc_net); + remove_proc_entry("ip_vs_stats", ipvs->net->proc_net); + remove_proc_entry("ip_vs", ipvs->net->proc_net); free_percpu(ipvs->tot_stats.cpustats); }