hwmon: (nzxt-smart2) Fix "unused function" warning
PATCH 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]>
--- drivers/hwmon/nzxt-smart2.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hwmon/nzxt-smart2.c +4 -0
@@ -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) {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) {
Signature · 1 line
2.34.1
Guenter Roeck
maintainerQuoted 17 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]>--- drivers/hwmon/nzxt-smart2.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/hwmon/nzxt-smart2.c +0
-0
drivers/hwmon/nzxt-smart2.c static int nzxt_smart2_hid_raw_event(struct hid_device *hdev, · line 709
Quoted 6 lines
drivers/hwmon/nzxt-smart2.c +2
-0@@ -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
Quoted 12 lines
drivers/hwmon/nzxt-smart2.c +2
-0{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) {