Re: [PATCH] hwmon: (nzxt-smart2) Fix "unused function" warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/27/21 4:13 PM, Aleksandr Mezin wrote:
Fix warning when building with CONFIG_PM=n (and CONFIG_WERROR=y):

drivers/hwmon/nzxt-smart2.c:707:12: error: ‘nzxt_smart2_hid_reset_resume’
defined but not used [-Werror=unused-function]
   707 | static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Aleksandr Mezin <mezin.alexander@xxxxxxxxx>
---
  drivers/hwmon/nzxt-smart2.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
index 534d39b8908e..6033249bf06d 100644
--- a/drivers/hwmon/nzxt-smart2.c
+++ b/drivers/hwmon/nzxt-smart2.c
@@ -704,6 +704,8 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev,
  	return 0;
  }
+#ifdef CONFIG_PM
+
  static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)

Please use __maybe_unused instead.

Guenter

  {
  	struct drvdata *drvdata = hid_get_drvdata(hdev);
@@ -721,6 +723,8 @@ static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
  	return init_device(drvdata, drvdata->update_interval);
  }
+#endif
+
  static int nzxt_smart2_hid_probe(struct hid_device *hdev,
  				 const struct hid_device_id *id)
  {





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux