From patchwork Tue Oct 2 21:10:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 148023 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5639914lji; Tue, 2 Oct 2018 14:11:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV61czA5juRaxfBcgFB8G8+2naRjkc2gUSx6/9jvyaTqMpgYHxA+nQU08NiVud2MwP7KP3QhA X-Received: by 2002:a62:24c3:: with SMTP id k64-v6mr18394622pfk.195.1538514679090; Tue, 02 Oct 2018 14:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538514679; cv=none; d=google.com; s=arc-20160816; b=1FsZNySRP9u6q2894iNQzeQMvHolRQnKaO9FpHnhLAE8iy98IjeVCNSU/fhkrHhDWk at537gY4dO/R3831f0VxgQLWiW7sCtQUBhjACgLjagDfqN9sm8wQZwnEsd63YpmFYbKj X9yB1x64ZevstSMFOc/UcCS7Oc+imTfsPvdXqNlT+2LAQhxogbkGnLxybAkE472cNnxb n4T3kvTIEmMzksxs9I33eS2cm/z6heWOt1L7+rtI4ONCgzwAZKOgTnu7Mx/z/aUxBDAC DQGKGoM68Ntq9IRAqANll0znRCgRgJVMH8YKf0/g5O1doVbEO2pP6P6Qt3GoUmVvnZ1z aUVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=bocPgVJzj9Sm4yOFHt/fhfDLJwIXyzqCJ2PsgDO6fbQ=; b=TNn200pT8XEJD24pFB7DyP0shZFAKshlX3ZJljYjySeFp1RJmMhg9nobjrotwlbVSt soskIOaOBRPGaKpXXjm27eMNfk0NXvBFc8dx59YS2nvQmPy75+YYvfXvvRHeZWyYpjX0 Vm65ZyIIgb7lcMBr2ACKOTGrhPCAAHpDuC3+/ns7+A9KohC/nlZrhzKwZgDmnDmai2Tn THg82NcasysLEN40W3+xmWXlOXD6DOlK6f4Sp+IzlDZtE9vheQ7g6cA9JlhvbNm816c2 l2lBkb8mz1tWEvsGC9ndgux0NgjzXH3aJra1Z9iSicaEMJnelu5cCQDrZAAYqpfvvPJz MbxQ== 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 i64-v6si17619070pfc.16.2018.10.02.14.11.18; Tue, 02 Oct 2018 14:11:19 -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; 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 S1728321AbeJCD4e (ORCPT + 32 others); Tue, 2 Oct 2018 23:56:34 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:50345 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbeJCD4d (ORCPT ); Tue, 2 Oct 2018 23:56:33 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MC2o9-1g1hJF3fRN-00CNds; Tue, 02 Oct 2018 23:10:56 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MC2o9-1g1hJF3fRN-00CNds; Tue, 02 Oct 2018 23:10:56 +0200 From: Arnd Bergmann To: Jean Delvare , Guenter Roeck Cc: Arnd Bergmann , Nicolin Chen , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: ina3221: mark PM functions as __maybe_unused Date: Tue, 2 Oct 2018 23:10:47 +0200 Message-Id: <20181002211054.2654746-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:AWAUVauV1leeCsuY40J7OzBwYmEDTuCejW8uq2wJywkpRoGcnqr NJ3c+dsRJTzJo9S+CPFgVdZKWEhUs8jrd9bHReMmg6jcQFZkACZSX1m1QAEicqFXcerKt/O dDRuVExWpmrgxzMnV7JtPZvOsAQHzkoHzgLvdSbyiCc+t5fe1m6k+gOgypE5kSBLtIER6cc a/nNEAEDw91pHfgnFHXYA== X-UI-Out-Filterresults: notjunk:1; V01:K0:UnAOkePO3Q4=:Umb8hOZsOpS/uo+qO66oQP 9za/4WRUYeKeKMgUokRYtAWzXWaow7wJ3CRtYalqS7oUXzm70bIwhoCGFyGcWGh9KD5hD4cIr qyTj3pi95G56c3QfQ6ZNL2F7aExSsmuRgybub8LTcngQjOjOdbXokO7q6W6Fm9dp5LRwfQzoo JkUZqWsQuaXHGXuI6+YAHrHuQWmlj8Nvzr8pzi+iQKc71eKw88E3wQCJrKWFAtmzy8F64QLKK C7j8ljnBmNu1s9FvjmCBbSbTbiGxZq9H27/dlmt/qI/gpdZPDC9cwgq9GOVsWWauFlQvdl1+j ngMjo8iL272aZ2kuxHFgy2xR0RD39pzbGCLgpko/QAD7f3lZig9bgPJjddUg1mHUaQjRVwC3Q 62R/PBJuUbHUM6SMxK9zqBmDgIWBdugBWawQemuVbPOzWI/eMKtiyrgMvkLonhBXA8T7EUVSb 2mGoZcGlVNIndFNKNXT/AxaCZ3m0+/dvbnyi2CMBk+gYI7VMiscAK8GcI9wWEE68bRfkk3Q2b tn9cZkpRAJCrt51FJwlaaLCf+EzTR67gr+tEhqGXdaPieUMCOx4ubTIhQMtiOT3yi8G8uGrGt 5gjTywRIdIq1ia2A/uf7Qfzkl4UouEMRLSWzE7BI34H1Q+Kuooy6Bq/qK/6/do3NBJmFKxOq9 NPVxCIqxsB6483W4BT07EdAYBf9ZEbPDbfcqKpYN8GVizVcBYdw7+erAV8lq7tB98QgU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_PM_SLEEP is disabled, we get a warning about unused suspend/resume functions: drivers/hwmon/ina3221.c:451:12: error: 'ina3221_resume' defined but not used [-Werror=unused-function] static int ina3221_resume(struct device *dev) drivers/hwmon/ina3221.c:428:12: error: 'ina3221_suspend' defined but not used [-Werror=unused-function] static int ina3221_suspend(struct device *dev) Picking the correct #ifdef check is hard, so let's remove that check and instead mark the functions as __maybe_unused to let the compiler silently drop them instead. Fixes: 7de1ab9dac8e ("hwmon: (ina3221) Add suspend and resume functions") Signed-off-by: Arnd Bergmann --- drivers/hwmon/ina3221.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.18.0 diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c index 1e38b4c43fbf..8c3352910cc4 100644 --- a/drivers/hwmon/ina3221.c +++ b/drivers/hwmon/ina3221.c @@ -424,8 +424,7 @@ static int ina3221_probe(struct i2c_client *client, return 0; } -#ifdef CONFIG_PM -static int ina3221_suspend(struct device *dev) +static int __maybe_unused ina3221_suspend(struct device *dev) { struct ina3221_data *ina = dev_get_drvdata(dev); int ret; @@ -448,7 +447,7 @@ static int ina3221_suspend(struct device *dev) return 0; } -static int ina3221_resume(struct device *dev) +static int __maybe_unused ina3221_resume(struct device *dev) { struct ina3221_data *ina = dev_get_drvdata(dev); int ret; @@ -474,7 +473,6 @@ static int ina3221_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops ina3221_pm = { SET_SYSTEM_SLEEP_PM_OPS(ina3221_suspend, ina3221_resume)