015-8-qcom-tsens-8916-mark-PM-functions-__maybe_unused.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 5b97469a55872a30a0d53a1279a8ae8b1c68b52c Mon Sep 17 00:00:00 2001
  2. From: Arnd Bergmann <arnd@arndb.de>
  3. Date: Mon, 4 Jul 2016 15:12:28 +0200
  4. Subject: thermal: qcom: tsens-8916: mark PM functions __maybe_unused
  5. The newly added tsens-8916 driver produces warnings when CONFIG_PM
  6. is disabled:
  7. drivers/thermal/qcom/tsens.c:53:12: error: 'tsens_resume' defined but not used [-Werror=unused-function]
  8. static int tsens_resume(struct device *dev)
  9. ^~~~~~~~~~~~
  10. drivers/thermal/qcom/tsens.c:43:12: error: 'tsens_suspend' defined but not used [-Werror=unused-function]
  11. static int tsens_suspend(struct device *dev)
  12. ^~~~~~~~~~~~~
  13. This marks both functions __maybe_unused to let the compiler
  14. know that they might be used in other configurations, without
  15. adding ugly #ifdef logic.
  16. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  17. Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org>
  18. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  19. ---
  20. drivers/thermal/qcom/tsens.c | 4 ++--
  21. 1 file changed, 2 insertions(+), 2 deletions(-)
  22. --- a/drivers/thermal/qcom/tsens.c
  23. +++ b/drivers/thermal/qcom/tsens.c
  24. @@ -40,7 +40,7 @@ static int tsens_get_trend(void *data, l
  25. return -ENOTSUPP;
  26. }
  27. -static int tsens_suspend(struct device *dev)
  28. +static int __maybe_unused tsens_suspend(struct device *dev)
  29. {
  30. struct tsens_device *tmdev = dev_get_drvdata(dev);
  31. @@ -50,7 +50,7 @@ static int tsens_suspend(struct device *
  32. return 0;
  33. }
  34. -static int tsens_resume(struct device *dev)
  35. +static int __maybe_unused tsens_resume(struct device *dev)
  36. {
  37. struct tsens_device *tmdev = dev_get_drvdata(dev);