Skip to contentSkip to conversation

hwmon: (nzxt-smart2) Fix "unused function" warning

PATCH Applied Aleksandr Mezin 2 participants 2 messages Dec 28, 2021 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hwmon: (nzxt-smart2) Fix "unused function" warning

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)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

---
v2: __maybe_unused instead of #ifdef

 drivers/hwmon/nzxt-smart2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/nzxt-smart2.c +1 -1
index 534d39b8908e..6e67da766969 100644
@@ -704,7 +704,7 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev,
 	return 0;
 }
 
-static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
+static int __maybe_unused nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 {
 	struct drvdata *drvdata = hid_get_drvdata(hdev);
 
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Aleksandr Mezin

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)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Applied.

Thanks,
Guenter

Quoted 19 lines

---
v2: __maybe_unused instead of #ifdef

 drivers/hwmon/nzxt-smart2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/nzxt-smart2.c +1 -1
index 534d39b8908e..6e67da766969 100644
@@ -704,7 +704,7 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev,
 	return 0;
 }
 
-static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
+static int __maybe_unused nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 {
 	struct drvdata *drvdata = hid_get_drvdata(hdev);