Message ID | 20211228014813.832491-1-mezin.alexander@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v2] hwmon: (nzxt-smart2) Fix "unused function" warning | expand |
On Tue, Dec 28, 2021 at 07:48:13AM +0600, 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@gmail.com> Applied. Thanks, Guenter > --- > v2: __maybe_unused instead of #ifdef > > drivers/hwmon/nzxt-smart2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c > index 534d39b8908e..6e67da766969 100644 > --- a/drivers/hwmon/nzxt-smart2.c > +++ b/drivers/hwmon/nzxt-smart2.c > @@ -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); >
diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c index 534d39b8908e..6e67da766969 100644 --- a/drivers/hwmon/nzxt-smart2.c +++ b/drivers/hwmon/nzxt-smart2.c @@ -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);
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@gmail.com> --- v2: __maybe_unused instead of #ifdef drivers/hwmon/nzxt-smart2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)