thermal: qcom: tsens-8916: mark PM functions __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Jul 2016 13:12:28 +0000 (15:12 +0200)
committerZhang Rui <rui.zhang@intel.com>
Tue, 27 Sep 2016 06:02:16 +0000 (14:02 +0800)
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>
Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/qcom/tsens.c

index 446f70b5dbb2f12039b3b6126a75c8a9a7473ad2..3f9fe6aa51ccc1eaf531c1dce51578b5d25c7271 100644 (file)
@@ -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);