linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/DAC960.c: fix defined but not used build warnings
@ 2018-07-07  3:49 Randy Dunlap
  2018-07-07 18:54 ` Jens Axboe
  2018-07-09  6:07 ` Hannes Reinecke
  0 siblings, 2 replies; 3+ messages in thread
From: Randy Dunlap @ 2018-07-07  3:49 UTC (permalink / raw)
  To: linux-block, axboe; +Cc: LKML

From: Randy Dunlap <rdunlap@infradead.org>

Fix build warnings in DAC960.c when CONFIG_PROC_FS is not enabled
by marking the unused functions as __maybe_unused.

../drivers/block/DAC960.c:6429:12: warning: 'dac960_proc_show' defined but not used [-Wunused-function]
../drivers/block/DAC960.c:6449:12: warning: 'dac960_initial_status_proc_show' defined but not used [-Wunused-function]
../drivers/block/DAC960.c:6456:12: warning: 'dac960_current_status_proc_show' defined but not used [-Wunused-function]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
---
 drivers/block/DAC960.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- linux-next-20180706.orig/drivers/block/DAC960.c
+++ linux-next-20180706/drivers/block/DAC960.c
@@ -21,6 +21,7 @@
 #define DAC960_DriverDate			"21 Aug 2007"
 
 
+#include <linux/compiler.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
@@ -6426,7 +6427,7 @@ static bool DAC960_V2_ExecuteUserCommand
   return true;
 }
 
-static int dac960_proc_show(struct seq_file *m, void *v)
+static int __maybe_unused dac960_proc_show(struct seq_file *m, void *v)
 {
   unsigned char *StatusMessage = "OK\n";
   int ControllerNumber;
@@ -6446,14 +6447,16 @@ static int dac960_proc_show(struct seq_f
   return 0;
 }
 
-static int dac960_initial_status_proc_show(struct seq_file *m, void *v)
+static int __maybe_unused dac960_initial_status_proc_show(struct seq_file *m,
+							  void *v)
 {
 	DAC960_Controller_T *Controller = (DAC960_Controller_T *)m->private;
 	seq_printf(m, "%.*s", Controller->InitialStatusLength, Controller->CombinedStatusBuffer);
 	return 0;
 }
 
-static int dac960_current_status_proc_show(struct seq_file *m, void *v)
+static int __maybe_unused dac960_current_status_proc_show(struct seq_file *m,
+							  void *v)
 {
   DAC960_Controller_T *Controller = (DAC960_Controller_T *) m->private;
   unsigned char *StatusMessage =



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

* Re: [PATCH] block/DAC960.c: fix defined but not used build warnings
  2018-07-07  3:49 [PATCH] block/DAC960.c: fix defined but not used build warnings Randy Dunlap
@ 2018-07-07 18:54 ` Jens Axboe
  2018-07-09  6:07 ` Hannes Reinecke
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-07-07 18:54 UTC (permalink / raw)
  To: Randy Dunlap, linux-block; +Cc: LKML

On 7/6/18 9:49 PM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build warnings in DAC960.c when CONFIG_PROC_FS is not enabled
> by marking the unused functions as __maybe_unused.
> 
> ../drivers/block/DAC960.c:6429:12: warning: 'dac960_proc_show' defined but not used [-Wunused-function]
> ../drivers/block/DAC960.c:6449:12: warning: 'dac960_initial_status_proc_show' defined but not used [-Wunused-function]
> ../drivers/block/DAC960.c:6456:12: warning: 'dac960_current_status_proc_show' defined but not used [-Wunused-function]

Applied for 4.19, thanks Randy.

-- 
Jens Axboe


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

* Re: [PATCH] block/DAC960.c: fix defined but not used build warnings
  2018-07-07  3:49 [PATCH] block/DAC960.c: fix defined but not used build warnings Randy Dunlap
  2018-07-07 18:54 ` Jens Axboe
@ 2018-07-09  6:07 ` Hannes Reinecke
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2018-07-09  6:07 UTC (permalink / raw)
  To: Randy Dunlap, linux-block, axboe; +Cc: LKML

On 07/07/2018 05:49 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build warnings in DAC960.c when CONFIG_PROC_FS is not enabled
> by marking the unused functions as __maybe_unused.
> 
> ../drivers/block/DAC960.c:6429:12: warning: 'dac960_proc_show' defined but not used [-Wunused-function]
> ../drivers/block/DAC960.c:6449:12: warning: 'dac960_initial_status_proc_show' defined but not used [-Wunused-function]
> ../drivers/block/DAC960.c:6456:12: warning: 'dac960_current_status_proc_show' defined but not used [-Wunused-function]
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: linux-block@vger.kernel.org
> ---
>  drivers/block/DAC960.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 

Guess it's about time to resubmit my DAC960 rewrite.
Hope it get it done sometimes this week.

Cheers

Hannes

-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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

end of thread, other threads:[~2018-07-09  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-07  3:49 [PATCH] block/DAC960.c: fix defined but not used build warnings Randy Dunlap
2018-07-07 18:54 ` Jens Axboe
2018-07-09  6:07 ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).