hwmon: (nzxt-smart2) Fix "unused function" warning
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)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by Aleksandr Mezin <[email protected]>
---
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
@@ -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
Quoted 8 lines · Aleksandr Mezin
Fix warning when building with
CONFIG_PM=n(andCONFIG_WERROR=y):
drivers/hwmon/nzxt-smart2.c:707:12: error: ‘nzxt_smart2_hid_reset_resume’ defined but not used [-Werror=unused-function]
707 | static intnzxt_smart2_hid_reset_resume(struct hid_device *hdev)| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~Signed-off-by Aleksandr Mezin <[email protected]>
Applied.
Thanks,
Guenter
Quoted 19 lines
---
v2:__maybe_unusedinstead of #ifdefdrivers/hwmon/nzxt-smart2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/nzxt-smart2.c +1
-1@@ -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);