All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n
@ 2022-01-04 13:53 YueHaibing
  2022-01-04 14:40 ` Aleksandr Mezin
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2022-01-04 13:53 UTC (permalink / raw)
  To: mezin.alexander, jdelvare, linux; +Cc: linux-hwmon, linux-kernel, YueHaibing

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)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this.

Fixes: 0e43f31ee52f ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/hwmon/nzxt-smart2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
index 534d39b8908e..4963d630394a 100644
--- a/drivers/hwmon/nzxt-smart2.c
+++ b/drivers/hwmon/nzxt-smart2.c
@@ -704,6 +704,7 @@ 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);
@@ -720,6 +721,7 @@ 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.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n
  2022-01-04 13:53 [PATCH -next] hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n YueHaibing
@ 2022-01-04 14:40 ` Aleksandr Mezin
  0 siblings, 0 replies; 2+ messages in thread
From: Aleksandr Mezin @ 2022-01-04 14:40 UTC (permalink / raw)
  To: YueHaibing; +Cc: Jean Delvare, Guenter Roeck, linux-hwmon, linux-kernel

On Tue, Jan 4, 2022 at 7:54 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> 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)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Move it into #ifdef block to fix this.
>
> Fixes: 0e43f31ee52f ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/hwmon/nzxt-smart2.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
> index 534d39b8908e..4963d630394a 100644
> --- a/drivers/hwmon/nzxt-smart2.c
> +++ b/drivers/hwmon/nzxt-smart2.c
> @@ -704,6 +704,7 @@ 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);
> @@ -720,6 +721,7 @@ 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.17.1
>

Hi.

It's already fixed:
https://lore.kernel.org/all/20211228014813.832491-1-mezin.alexander@gmail.com/
(and already in linux-next:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/hwmon/nzxt-smart2.c?id=f103b2e5a6197586effb0b9a1b72c30b5d65b0cd
)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-04 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 13:53 [PATCH -next] hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n YueHaibing
2022-01-04 14:40 ` Aleksandr Mezin

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.