Skip to content

Commit

Permalink
thermal: qcom: tsens-8916: mark PM functions __maybe_unused
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Zhang Rui committed Sep 27, 2016
1 parent 4352844 commit 5b97469
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/qcom/tsens.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 5b97469

Please sign in to comment.