* [PATCH] hwmon: (nzxt-smart2) Fix "unused function" warning
@ 2021-12-28 0:13 Aleksandr Mezin
2021-12-28 0:28 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Aleksandr Mezin @ 2021-12-28 0:13 UTC (permalink / raw)
To: linux-hwmon; +Cc: Guenter Roeck, Jean Delvare, 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)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
---
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)
{
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)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (nzxt-smart2) Fix "unused function" warning
2021-12-28 0:13 [PATCH] hwmon: (nzxt-smart2) Fix "unused function" warning Aleksandr Mezin
@ 2021-12-28 0:28 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-12-28 0:28 UTC (permalink / raw)
To: Aleksandr Mezin, linux-hwmon; +Cc: Jean Delvare
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@gmail.com>
> ---
> 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)
> {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-28 0:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 0:13 [PATCH] hwmon: (nzxt-smart2) Fix "unused function" warning Aleksandr Mezin
2021-12-28 0:28 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.