From patchwork Thu Dec 12 14:03:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181494 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp930894ile; Thu, 12 Dec 2019 06:04:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzQS40nTHh0/SRMRm8WbNnnsCYPLUP1NtKaKTN+Fxt+s+oywXtXNOSC4AimLyonx3VDb9f+ X-Received: by 2002:a9d:48a:: with SMTP id 10mr7744890otm.95.1576159491572; Thu, 12 Dec 2019 06:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576159491; cv=none; d=google.com; s=arc-20160816; b=uOvgUkunihcJ2isIznSBB2F1CTmjZW4CaJLkkqitXb0xe0lGiW6NyaXjbfyG/gbN7l kaEmrl5kLQUhD0207Jl4irNdMz6zpJ0yAHxA9Gc+xtSaquGqshEuVLQoWpzHbM9K/7zQ MRbDBWHI7kN4o1/b0pUiBvG1X/WlqFLDNfjN8Tm5n8nsX8u8HxPo6xTc4OwIyeG3zrzf aAbxyIL8PveOmOTYscjSen0awLebt41Lel4J57DfUwK8q+iMg7xMBOLAV7tP+h2XMK02 CdK7EHkAvPWgfdvSU7P8f1DbMlFoFv6WRmbS8/KxggV/59ffB4NUPzyPIctDlK/VEtRU kTuw== 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 :message-id:date:subject:cc:to:from; bh=OzAaCTGJUC6y5teHkktO6GvVWQb6fjdOR9GxgDNAbM0=; b=L2MIDMv5Fvfbioot6O0JOQkKuIfzbt7QNMqFSd+jtVgxUVMSOav9jBzSTSmlj3MMUM kPPR6OsyhCVTPn68Gn1mIDtIbe+hFoH7746SkKoCPfLDZqpLc9vvTtlF0buLOkopfPWm nDBYPihtI66PfhOoOXkSqEh2v/7sTCMUMqCX9HndfHuf3OXR7L92BgACa8/ulNyRHRSM nYSzlsfmcIzL5iEaYt6/RSxVwrUFW65PfmuLvU0VJdJxARxvhheWtkG1w/WMFS8J8L5L dyexAnv8rfdF8ivN5LjJ4UE8LDc+d7yf+ebuYhvcuLXqLuXrA2pGpbbrK5AKTIWbrIiq ODxg== 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 z23si3056132otm.284.2019.12.12.06.04.51; Thu, 12 Dec 2019 06:04:51 -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 S1729677AbfLLOEt (ORCPT + 27 others); Thu, 12 Dec 2019 09:04:49 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:58067 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729547AbfLLOEs (ORCPT ); Thu, 12 Dec 2019 09:04:48 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MnWx3-1hyxRR0wyr-00jZT4; Thu, 12 Dec 2019 15:04:20 +0100 From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Cc: Arnd Bergmann , Mike Travis , Steve Wahl , Dimitri Sivanich , Andrew Morton , Christoph Hellwig , "H. Peter Anvin" , Hedi Berriche , Justin Ernst , Peter Zijlstra , Russ Anderson , linux-kernel@vger.kernel.org Subject: [PATCH] x86/platform/uv: avoid unused variable warning Date: Thu, 12 Dec 2019 15:03:57 +0100 Message-Id: <20191212140419.315264-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:xM0uqZr408u8v1eBM37k4OWvemqZEVo56Zeor5mvcWZmUqaGS/N rp7miPPJEEw2z2rhDcFr64f+PswFnItkjVLoEcoCy3Sf4YEaK8GSNGN4ft4AzaBCD/2TxKf uY6+hnmNRu+COxLEqhNjK3Yjhb29CvHiNcJURn1BynstdGNOqQgepnB2komWcqDaTD202tl cQxYRwh+VDrXjvyav5vEw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:hjjuQndz3YI=:0OyZ9O/LRsulaDG9L2UeJj stMrjmFNMBbwVdmQeExisj9/9tcZyKfCumIPtU58wMWyQqCXLTNsmwnU+tGEGTMdrwFftwdj9 DDan7ylswG1dr5a+N7cE7GEtYsPRnGDsbq1Px/8iYI4aVkC8dubuRXqebMuKF075Kl6sEe2ns s11pOmum7A8KHGzU+n96/pBOh3GrQy3oWAjutb9mg6XLiXnYSEDa6Eul8iKyaPbOC1skEfUE1 Z6AUxEODiGqAw75xMsUi6Aoj3DGzsVts3WWbPRj1w5/xDIoGfstvBFybZ9uC80Md3R9quwowf Spen7aZTNJFBsrx/GeUP4wbQBLwaUT7mkWx8L7RfjV9MmvpOVFy6nIB4pE3gdxwFfapT+3Gbb 2pUPucKb3E8FxJ9ZSaTpY6VC7JbdvIIo+p2fZ84Co6cNR5EbQqd2XFVzb42gUWWCrAZegjC8l 4HQiWhXsa4YgUN0q6WIIWt+NoAWLgRIcRRspY5P7f/EbPoyLihChFYbviq4TfKsu2DZeRKYro duMC2mk6upVie3gix98IsJArP1dxwVZlmvDoJ/ZHDTQUTCqy2SuXatGNISgY9SsVFuEFHXS6L PbqD3e3ydiZ7aZ1upciX6NjUnVctIF7sY86+4P5nNUcrJALR3/8KcWmALFsuBno9Ivs4wncSa ui6Y3vTjpLesito4UpchfpX1L7qzrQlrv8t7/Rt/J+TzlWTt7BixApUFmcAol1jcbA4VeORKG RmC/FCnoR/Z+4HZjTJ7UGp/7UKoB+/Uji36bGiG30aWfyxL39s4QyuEEGS13UB+/PuA2Rev6/ id2J8nhqZ1APdGBMlf6oNSUS9TpNO2hGd4+UxaWnfvbu1F4vDhMh6NQyW5ISdzEz3sx+Pl4Hw AFD0JvcIDyJYpqG1+eEg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kernel/apic/x2apic_uv_x.c | 43 +++++------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) -- 2.20.0 diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index d5b51a740524..ad53b2abc859 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 */