All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi/button.c: fix defined but not used warning
@ 2018-07-07 15:25 Randy Dunlap
  2018-07-11  9:37 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2018-07-07 15:25 UTC (permalink / raw)
  To: ACPI Devel Mailing List, Rafael J. Wysocki; +Cc: Len Brown, LKML

From: Randy Dunlap <rdunlap@infradead.org>

Fix a build warning in the ACPI button driver when CONFIG_PROC_FS
is not enabled by marking the unused function as __maybe_unused.

../drivers/acpi/button.c:252:12: warning: 'acpi_button_state_seq_show' defined but not used [-Wunused-function]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
---
 drivers/acpi/button.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-next-20180706.orig/drivers/acpi/button.c
+++ linux-next-20180706/drivers/acpi/button.c
@@ -21,6 +21,7 @@
 
 #define pr_fmt(fmt) "ACPI: button: " fmt
 
+#include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -249,7 +250,8 @@ static int acpi_lid_notify_state(struct
 	return ret;
 }
 
-static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
+static int __maybe_unused acpi_button_state_seq_show(struct seq_file *seq,
+						     void *offset)
 {
 	struct acpi_device *device = seq->private;
 	int state;

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

* Re: [PATCH] acpi/button.c: fix defined but not used warning
  2018-07-07 15:25 [PATCH] acpi/button.c: fix defined but not used warning Randy Dunlap
@ 2018-07-11  9:37 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2018-07-11  9:37 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: ACPI Devel Mailing List, Len Brown, LKML

On Saturday, July 7, 2018 5:25:01 PM CEST Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix a build warning in the ACPI button driver when CONFIG_PROC_FS
> is not enabled by marking the unused function as __maybe_unused.
> 
> ../drivers/acpi/button.c:252:12: warning: 'acpi_button_state_seq_show' defined but not used [-Wunused-function]
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> ---
>  drivers/acpi/button.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> --- linux-next-20180706.orig/drivers/acpi/button.c
> +++ linux-next-20180706/drivers/acpi/button.c
> @@ -21,6 +21,7 @@
>  
>  #define pr_fmt(fmt) "ACPI: button: " fmt
>  
> +#include <linux/compiler.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
> @@ -249,7 +250,8 @@ static int acpi_lid_notify_state(struct
>  	return ret;
>  }
>  
> -static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
> +static int __maybe_unused acpi_button_state_seq_show(struct seq_file *seq,
> +						     void *offset)
>  {
>  	struct acpi_device *device = seq->private;
>  	int state;
> 

Applied, thanks!

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

end of thread, other threads:[~2018-07-11  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-07 15:25 [PATCH] acpi/button.c: fix defined but not used warning Randy Dunlap
2018-07-11  9:37 ` Rafael J. Wysocki

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.