Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436489

[PATCH] thermal: qcom: tsens-8916: mark PM functions __maybe_unused

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH] thermal: qcom: tsens-8916: mark PM functions __maybe_unused
Date Mon, 04 Jul 2016 15:20:01 +0200
Message-ID <rRbX3-63R-9@gated-at.bofh.it> (permalink)
X-Mailer git-send-email 2.9.0
X-Provags-ID V03:K0:SW0Fpk/ya3bUEpPtCYjZFWIet6C9Nmb/s3WHAGHe0wr42tO6h/R NgMaDz+oWDr0WqKhMTjVZOrsuE463Oi6iKqzRKJyde7o712uLm3X5C74OSXQHJWN/gYHrqE brCRLOGucyvoeo2N2P+7SQ1X8L1jVy0c6ARxyavODmHpxD9Y+SIGA7UZAj1Y3TMT+H15GM+ mFr7eMzAS+59G5A3JQzAQ==
X-Ui-Out-Filterresults notjunk:1;V01:K0:/JLooocLDLc=:kDY4YZRcJvnc5HCqSUNJtv nhJaI/y5M1QIHo4ctgTvjPF9olRVCML6dEujF6e3lfuZpJIg1ovVKR7LLbxRnDpngF7O6hWAa qumsabxeUxGK7PD2tD44H9TwtLBKo0UPHDA70Lsi+QSmN6hqifS/lAj1OJwFf+HBYmzubag0E R09rZHAavxW2z8sJI7EMAG4MQJ1W2DnZO0JY0LuMpAuWcm0ReN9hwzPGn5UE2SkQECYRZElPa bNsouw/YLHDm9YvDQ2LbZ+3oaF+8JXkaamgfKWjixjjoYKAx+W3boqeJroRCUAR3NBoR4ULRI 9DoNGGDk3VkaZhFi3t/ShvPRatdHDUPuPWt5J12VNmDiZv1zDftIb2WBbGU2fDfMTJGmR+K1G Qf+hwt6wyrsatOGpWCFz97aKG90z9aSQi2IXiv8WsDVtdrlGfjf0hCApuYGSYnh6rSM9QyXL/ V8xokSdMeISXL4wnvO+aB40mUlqAnXH7nu+BffaeuBSwua6vzHojLtPFBmSs2RZCzzKe7Nbm7 MZAoL5yuCE0fUgAxqGCwBpaaJEVDRcgzrqcdnQYr5yVXYy+m/C038Vnw7/4ATr8PkP6BXyKuP 0OdIPCAtKII1veeDxbpz9nxOIzE/fsr3BS71N1wvGdHwyWPotIu46B3ugD3g6adsaf0Fcu+x4 CsrXuI9Jze2zWtxrLIUo4jOfnD2MNbnRUgb7g4cy3bf+INKSYTUNFsYwaqcajaZsfqBc=
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc Arnd Bergmann <arnd@arndb.de>, Zhang Rui <rui.zhang@intel.com>, Rajendra Nayak <rnayak@codeaurora.org>, Lina Iyer <lina.iyer@linaro.org>, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 4 Jul 2016 15:12:28 +0200
X-Original-Message-ID <20160704131318.990672-1-arnd@arndb.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1436489

Show key headers only | View raw


The newly added tsens-8916 driver produces warnings when CONFIG_PM
is disabled:

drivers/thermal/qcom/tsens.c:53:12: error: 'tsens_resume' defined but not used [-Werror=unused-function]
 static int tsens_resume(struct device *dev)
            ^~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:43:12: error: 'tsens_suspend' defined but not used [-Werror=unused-function]
 static int tsens_suspend(struct device *dev)
            ^~~~~~~~~~~~~

This marks both functions __maybe_unused to let the compiler
know that they might be used in other configurations, without
adding ugly #ifdef logic.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/thermal/qcom/tsens.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 446f70b5dbb2..e4fca3350d26 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -40,7 +40,7 @@ static int tsens_get_trend(void *p, int trip, enum thermal_trend *trend)
 	return -ENOTSUPP;
 }
 
-static int tsens_suspend(struct device *dev)
+static int  __maybe_unused tsens_suspend(struct device *dev)
 {
 	struct tsens_device *tmdev = dev_get_drvdata(dev);
 
@@ -50,7 +50,7 @@ static int tsens_suspend(struct device *dev)
 	return 0;
 }
 
-static int tsens_resume(struct device *dev)
+static int __maybe_unused  tsens_resume(struct device *dev)
 {
 	struct tsens_device *tmdev = dev_get_drvdata(dev);
 
-- 
2.9.0

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] thermal: qcom: tsens-8916: mark PM functions __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2016-07-04 15:20 +0200
  Re: [PATCH] thermal: qcom: tsens-8916: mark PM functions __maybe_unused Rajendra Nayak <rnayak@codeaurora.org> - 2016-07-05 04:40 +0200

csiph-web