Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v2] hwmon: (nzxt-smart2) Fix "unused function" warning
@ 2021-12-28  1:48 Aleksandr Mezin
  2021-12-28  2:22 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksandr Mezin @ 2021-12-28  1:48 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>
---
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);
 
-- 
2.34.1


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

* Re: [PATCH v2] hwmon: (nzxt-smart2) Fix "unused function" warning
  2021-12-28  1:48 [PATCH v2] hwmon: (nzxt-smart2) Fix "unused function" warning Aleksandr Mezin
@ 2021-12-28  2:22 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-12-28  2:22 UTC (permalink / raw)
  To: Aleksandr Mezin; +Cc: linux-hwmon, Jean Delvare

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);
>  

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

end of thread, other threads:[~2021-12-28  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-28  1:48 [PATCH v2] hwmon: (nzxt-smart2) Fix "unused function" warning Aleksandr Mezin
2021-12-28  2:22 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox