All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] DAC960: hide unused procfs helpers
@ 2018-07-13  7:16 YueHaibing
  2018-07-13  9:19 ` YueHaibing
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-07-13  7:16 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, linux-block, YueHaibing

When CONFIG_PROC_FS isn't set, gcc warning this:

drivers/block/DAC960.c:6429:12: warning: ‘dac960_proc_show’ defined but not used [-Wunused-function]
 static int dac960_proc_show(struct seq_file *m, void *v)
            ^
drivers/block/DAC960.c:6449:12: warning: ‘dac960_initial_status_proc_show’ defined but not used [-Wunused-function]
 static int dac960_initial_status_proc_show(struct seq_file *m, void *v)
            ^
drivers/block/DAC960.c:6456:12: warning: ‘dac960_current_status_proc_show’ defined but not used [-Wunused-function]
 static int dac960_current_status_proc_show(struct seq_file *m, void *v)
            ^
fix this by adding #ifdef around them.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/block/DAC960.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index f651806..7a05831 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -6426,6 +6426,7 @@ static bool DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
   return true;
 }
 
+#ifdef CONFIG_PROC_FS
 static int dac960_proc_show(struct seq_file *m, void *v)
 {
   unsigned char *StatusMessage = "OK\n";
@@ -6485,6 +6486,7 @@ static int dac960_current_status_proc_show(struct seq_file *m, void *v)
 	seq_printf(m, "%.*s", Controller->CurrentStatusLength, Controller->CurrentStatusBuffer);
 	return 0;
 }
+#endif
 
 static int dac960_user_command_proc_show(struct seq_file *m, void *v)
 {
-- 
2.7.0

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

* Re: [PATCH] DAC960: hide unused procfs helpers
  2018-07-13  7:16 [PATCH] DAC960: hide unused procfs helpers YueHaibing
@ 2018-07-13  9:19 ` YueHaibing
  0 siblings, 0 replies; 2+ messages in thread
From: YueHaibing @ 2018-07-13  9:19 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, linux-block

Pls ignore this, there has a fix.

[PATCH] block/DAC960.c: fix defined but not used build warnings

On 2018/7/13 15:16, YueHaibing wrote:
> When CONFIG_PROC_FS isn't set, gcc warning this:
> 
> drivers/block/DAC960.c:6429:12: warning: ‘dac960_proc_show’ defined but not used [-Wunused-function]
>  static int dac960_proc_show(struct seq_file *m, void *v)
>             ^
> drivers/block/DAC960.c:6449:12: warning: ‘dac960_initial_status_proc_show’ defined but not used [-Wunused-function]
>  static int dac960_initial_status_proc_show(struct seq_file *m, void *v)
>             ^
> drivers/block/DAC960.c:6456:12: warning: ‘dac960_current_status_proc_show’ defined but not used [-Wunused-function]
>  static int dac960_current_status_proc_show(struct seq_file *m, void *v)
>             ^
> fix this by adding #ifdef around them.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/block/DAC960.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
> index f651806..7a05831 100644
> --- a/drivers/block/DAC960.c
> +++ b/drivers/block/DAC960.c
> @@ -6426,6 +6426,7 @@ static bool DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
>    return true;
>  }
>  
> +#ifdef CONFIG_PROC_FS
>  static int dac960_proc_show(struct seq_file *m, void *v)
>  {
>    unsigned char *StatusMessage = "OK\n";
> @@ -6485,6 +6486,7 @@ static int dac960_current_status_proc_show(struct seq_file *m, void *v)
>  	seq_printf(m, "%.*s", Controller->CurrentStatusLength, Controller->CurrentStatusBuffer);
>  	return 0;
>  }
> +#endif
>  
>  static int dac960_user_command_proc_show(struct seq_file *m, void *v)
>  {
> 

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13  7:16 [PATCH] DAC960: hide unused procfs helpers YueHaibing
2018-07-13  9:19 ` YueHaibing

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.