Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1634830ybv; Fri, 21 Feb 2020 00:42:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzKkQ0psrf2Xwk4b8IWZoQlMc6RmO8dwx7LaCkPkLfiPrdep+6g604lwoSHX9hh1QoxV6BP X-Received: by 2002:a9d:6ac2:: with SMTP id m2mr27456258otq.191.1582274563711; Fri, 21 Feb 2020 00:42:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582274563; cv=none; d=google.com; s=arc-20160816; b=WHDtuNK2krEKiRQ2kGM7v2uTw1p2ICb4jb3cHxeyVIEBcq77wH6zOkxjHyvt4zSaZY DP39yj6+Xr10VqT14mzbiz5OF31AjZWyNBOZkafGKQhUUy2UeHccB/XDro3Q4AnCJ5X/ GhSwFKi4uYb2RuB3T+w0MBU3kuHFWT1m4k9K2aDvhUMip+dEkQNlQIRZxjqChTx/eHlf BnMOI3NZfXsfwd3wwp8kkWpm+qiq3wHwtjQMA1RSY0W/pFRpsM5DevC0Gq3WIDKHSR2O qB5rzP8veiHahecyWqG30a1ahmdn31H2JXX2eNKacoPguW5ZR83pkjwn3dNb60Nuq3Xm 0s2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VYjAmazvFYtAgD6ye18qs2HkV0l4nQOp5ylLOsHuxrU=; b=wnhvPLhpqdYq13rEfXBMIdcEZMQRQxLvev3CyavTkyluKzsKYt7bEZtwTeIwJRaGP/ S8kXVUrnjrvEE2h7blK1hukQWvw2uZjC6jSxzkXNroJ60QyvHUezDg4zTjEPxUY92uR6 SZhivVyJcF52cIAMEv3+NqNBfCyD4BYCVN5xTXjJ0Prv5bHkLx9yUibHN6OIDky5l9lQ dgetwAWdJscrhHH3wgew5tv+/b9EnBg4f0gJJ8wmHr5g137YMasctq292lH88sgxCnXj m7vHyVuA1Z6xKnOz/S6zwIFjoFf12Hnn/2EbyBfZIWxqO+PzihFTx6DGbmkAzUA48FA3 283Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="PnHtnV/n"; 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 g5si1147457otn.232.2020.02.21.00.42.31; Fri, 21 Feb 2020 00:42:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b="PnHtnV/n"; 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 S1730461AbgBUH4W (ORCPT + 99 others); Fri, 21 Feb 2020 02:56:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:55536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730439AbgBUH4Q (ORCPT ); Fri, 21 Feb 2020 02:56:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D020020658; Fri, 21 Feb 2020 07:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271776; bh=+Wg4Gw4fZ5TTS9SszO08Pg0ea8fhiVFTvIFd07PEKJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PnHtnV/n+FGdOtkzqbKahhrPST57UfCNgXo+XXECILq/SxZbA/hWJE8WpaDPAkI96 O089uAlAT5BTthmpj+mKVNoYEtP5P4fk/0wuhVGLxebR/g+GwYYKEIOFK6uc0+QY68 fS52Y/pt95Ew3+VKV09HA3Da1UGDyUyTGWdxX0nc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Thomas Gleixner , Sasha Levin Subject: [PATCH 5.5 294/399] x86/apic/uv: Avoid unused variable warning Date: Fri, 21 Feb 2020 08:40:19 +0100 Message-Id: <20200221072430.340899179@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit d0b7788804482b2689946cd8d910ac3e03126c8d ] When CONFIG_PROC_FS is disabled, the compiler warns about an unused variable: arch/x86/kernel/apic/x2apic_uv_x.c: In function 'uv_setup_proc_files': arch/x86/kernel/apic/x2apic_uv_x.c:1546:8: error: unused variable 'name' [-Werror=unused-variable] char *name = hubless ? "hubless" : "hubbed"; Simplify the code so this variable is no longer needed. Fixes: 8785968bce1c ("x86/platform/uv: Add UV Hubbed/Hubless Proc FS Files") Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20191212140419.315264-1-arnd@arndb.de Signed-off-by: Sasha Levin --- arch/x86/kernel/apic/x2apic_uv_x.c | 43 +++++------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index d5b51a740524d..ad53b2abc859f 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1493,65 +1493,34 @@ static void check_efi_reboot(void) } /* Setup user proc fs files */ -static int proc_hubbed_show(struct seq_file *file, void *data) +static int __maybe_unused proc_hubbed_show(struct seq_file *file, void *data) { seq_printf(file, "0x%x\n", uv_hubbed_system); return 0; } -static int proc_hubless_show(struct seq_file *file, void *data) +static int __maybe_unused proc_hubless_show(struct seq_file *file, void *data) { seq_printf(file, "0x%x\n", uv_hubless_system); return 0; } -static int proc_oemid_show(struct seq_file *file, void *data) +static int __maybe_unused proc_oemid_show(struct seq_file *file, void *data) { seq_printf(file, "%s/%s\n", oem_id, oem_table_id); return 0; } -static int proc_hubbed_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_hubbed_show, (void *)NULL); -} - -static int proc_hubless_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_hubless_show, (void *)NULL); -} - -static int proc_oemid_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_oemid_show, (void *)NULL); -} - -/* (struct is "non-const" as open function is set at runtime) */ -static struct file_operations proc_version_fops = { - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static const struct file_operations proc_oemid_fops = { - .open = proc_oemid_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static __init void uv_setup_proc_files(int hubless) { struct proc_dir_entry *pde; - char *name = hubless ? "hubless" : "hubbed"; pde = proc_mkdir(UV_PROC_NODE, NULL); - proc_create("oemid", 0, pde, &proc_oemid_fops); - proc_create(name, 0, pde, &proc_version_fops); + proc_create_single("oemid", 0, pde, proc_oemid_show); if (hubless) - proc_version_fops.open = proc_hubless_open; + proc_create_single("hubless", 0, pde, proc_hubless_show); else - proc_version_fops.open = proc_hubbed_open; + proc_create_single("hubbed", 0, pde, proc_hubbed_show); } /* Initialize UV hubless systems */ -- 2.20.1