From patchwork Tue May 10 07:18:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 67404 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1978113qge; Tue, 10 May 2016 00:19:01 -0700 (PDT) X-Received: by 10.66.172.165 with SMTP id bd5mr57175232pac.128.1462864741524; Tue, 10 May 2016 00:19:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si1204578pfm.126.2016.05.10.00.19.00; Tue, 10 May 2016 00:19:01 -0700 (PDT) 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=@linaro.org; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438AbcEJHS6 (ORCPT + 29 others); Tue, 10 May 2016 03:18:58 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38245 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055AbcEJHS5 (ORCPT ); Tue, 10 May 2016 03:18:57 -0400 Received: by mail-wm0-f54.google.com with SMTP id g17so10215210wme.1 for ; Tue, 10 May 2016 00:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=TjNYDi83sVnkkXbcahb/iY28x+GGg2Dn5DeJNDS70Y8=; b=DSHvfe3w0ZQrNtNMiY0ETmWkapKT0xl79sTxISMAX84D0/CfvEWydJsOk3oTdkiCpc hshWcHZ1rNihB2XJoBe5jti9GxyUzdBRAEdGwptrKVOI73zCVMBjpSjlZySlSQ56UK4u cJoUv93YBZSYPMd1i1HKFMbZgrIXxmPdAd9m4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TjNYDi83sVnkkXbcahb/iY28x+GGg2Dn5DeJNDS70Y8=; b=kZPce4Z0ad2OzfBlat7ISgYtqz20iX0ceLzQnCler+4QRVjp5lRgnKuED2BLNibIPx cGwE16Uu8lpXAMQ0RLba7WtYGhq2HR/SpdKrpIUATpCNtw3T2Sm7arftHGg+VaubX95B g95UaLwxdTLTqRjoABDbTj+wj2LDZ2UwrG6sp4muy9xo35XefJ/zbaTPe1K8yZ766uot kZAzs6QI3h1fSJiDJN72/u5hJp5Tjkg0NcJCl1QDmQIVIDjerelBxSoc8CV8iM/PGJK1 cojUjZXSUFnoQIOgj93lgNFOCSa49FKxYEZpIJcnLTRHUyY0Sr+45VFLLu+0rUyHUQvz YsgQ== X-Gm-Message-State: AOPr4FUqaLyj48vEv8uYlDl1cEtPcI7NZ/sQ5JJxrxxQM7MCou/y7Waq/2TJ3uH3p6AVsGpB X-Received: by 10.194.134.73 with SMTP id pi9mr36210024wjb.156.1462864735925; Tue, 10 May 2016 00:18:55 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id o129sm28371458wmb.17.2016.05.10.00.18.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 00:18:55 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: lina.iyer@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Mark Rutland , Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org (open list:POWER STATE COORD...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] firmware/drivers/psci: Fix unused functions when CONFIG_CPU_IDLE=n Date: Tue, 10 May 2016 09:18:49 +0200 Message-Id: <1462864729-11793-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the ARM64 architecture, when CPUIDLE is not set in the configuration, the compilation raises a couple of warnings: drivers/firmware/psci.c:70:12: warning: 'psci_pd_power_off' defined but not used [-Wunused-function] drivers/firmware/psci.c:273:12: warning: 'psci_set_suspend_mode_osi' defined but not used [-Wunused-function] Fix those warnings by moving the functions inside the #ifdef CONFIG_CPU_IDLE section. Signed-off-by: Daniel Lezcano --- drivers/firmware/psci.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index 9c6a1f9..d7e0632 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -54,7 +54,6 @@ */ static int resident_cpu = -1; static bool psci_has_osi_pd; -static bool psci_suspend_mode_is_osi; static DEFINE_PER_CPU(u32, cluster_state_id); static inline u32 psci_get_composite_state_id(u32 cpu_state) @@ -67,13 +66,6 @@ static inline void psci_reset_composite_state_id(void) this_cpu_write(cluster_state_id, 0); } -static int psci_pd_power_off(u32 state_idx, u32 param, - const struct cpumask *mask) -{ - __this_cpu_add(cluster_state_id, param); - return 0; -} - bool psci_tos_resident_on(int cpu) { return cpu == resident_cpu; @@ -270,6 +262,11 @@ static int __init psci_features(u32 psci_func_id) psci_func_id, 0, 0); } +#ifdef CONFIG_CPU_IDLE +static bool psci_suspend_mode_is_osi; + +static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state); + static int psci_set_suspend_mode_osi(bool enable) { int ret; @@ -290,8 +287,12 @@ static int psci_set_suspend_mode_osi(bool enable) return psci_to_linux_errno(ret); } -#ifdef CONFIG_CPU_IDLE -static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state); +static int psci_pd_power_off(u32 state_idx, u32 param, + const struct cpumask *mask) +{ + __this_cpu_add(cluster_state_id, param); + return 0; +} static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu) {