From patchwork Fri Sep 18 12:33:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 11784783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4D27746 for ; Fri, 18 Sep 2020 12:33:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7215E206D9 for ; Fri, 18 Sep 2020 12:33:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jmmufO+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7215E206D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ibY527a/0tTUORk7s+M6XVWNSaQd/SY0m2/FsNiNbaU=; b=jmmufO+Z4TFuRyElrKVe3PQrmw +1g+fjD4ZDYF3DaW3uJcMPb3WbwXwREs46Szw15EqHdmHGXhPxQ3vI1o0cxbvgP/Hb4NoUBZmvHR5 0Z0WPvLflWkZFh1MgwfnSVryv+1ENUgapbT3iF8drsMd8TZwmLEg2fpiPzJg5IRIi+Rb0MMSeGlrr JVKSwng4LN6C6hkXMLtnJQ82MdqQ4wshEQ8f9cXcx4oRcU4pg7WTnnfnMrj1c86e5RIMmncEseOwh MaLrJlfJ9OO/rgKwexzca/I8oYmzNqkIJsPCuDT1nTGo4GxqPt04KLgcBRq8zfeWRS6fDoe0IVaxE Yfti4ZiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJFaB-0004CA-7Z; Fri, 18 Sep 2020 12:33:43 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJFa8-0004AG-CS for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 12:33:41 +0000 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3F0B7D1A8F554734F9AA; Fri, 18 Sep 2020 20:33:31 +0800 (CST) Received: from localhost (10.174.179.108) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 20:33:24 +0800 From: YueHaibing To: , Subject: [PATCH -next] arm64: Fix -Wunused-function warning Date: Fri, 18 Sep 2020 20:33:18 +0800 Message-ID: <20200918123318.23764-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.108] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200918_083340_687044_944CB3BC X-CRM114-Status: GOOD ( 10.06 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [45.249.212.35 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.35 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: YueHaibing , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If CONFIG_HOTPLUG_CPU is n, gcc warns: arch/arm64/kernel/smp.c:967:13: warning: ‘ipi_teardown’ defined but not used [-Wunused-function] static void ipi_teardown(int cpu) ^~~~~~~~~~~~ Use #ifdef guard this. Signed-off-by: YueHaibing --- arch/arm64/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index b6bde2675ccc..82e75fc2c903 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -82,9 +82,9 @@ static int nr_ipi __read_mostly = NR_IPI; static struct irq_desc *ipi_desc[NR_IPI] __read_mostly; static void ipi_setup(int cpu); -static void ipi_teardown(int cpu); #ifdef CONFIG_HOTPLUG_CPU +static void ipi_teardown(int cpu); static int op_cpu_kill(unsigned int cpu); #else static inline int op_cpu_kill(unsigned int cpu) @@ -964,6 +964,7 @@ static void ipi_setup(int cpu) enable_percpu_irq(ipi_irq_base + i, 0); } +#ifdef CONFIG_HOTPLUG_CPU static void ipi_teardown(int cpu) { int i; @@ -974,6 +975,7 @@ static void ipi_teardown(int cpu) for (i = 0; i < nr_ipi; i++) disable_percpu_irq(ipi_irq_base + i); } +#endif void __init set_smp_ipi_range(int ipi_base, int n) {