linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: add 'struct gendisk' declaration
@ 2020-05-29 20:14 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2020-05-29 20:14 UTC (permalink / raw)
  To: Konstantin Khlebnikov, Jens Axboe
  Cc: Arnd Bergmann, Christoph Hellwig, Damien Le Moal,
	Bart Van Assche, Martin K. Petersen, Ming Lei, Ajay Joshi,
	linux-kernel

The added disk_start_io_acct() function declaration causes a warning
when CONFIG_BLOCK is disabled:

include/linux/blkdev.h:1895:41: error: declaration of 'struct gendisk' will not be visible outside of this function [-Werror,-Wvisibility]

Declare the struct tag before the function to suppress that warning.

Fixes: 956d510ee78c ("block: add disk/bio-based accounting helpers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/blkdev.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 36568c9d030a..96cf7af86b73 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1892,6 +1892,7 @@ static inline void blk_wake_io_task(struct task_struct *waiter)
 		wake_up_process(waiter);
 }
 
+struct gendisk;
 unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
 		unsigned int op);
 void disk_end_io_acct(struct gendisk *disk, unsigned int op,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-29 20:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 20:14 [PATCH] block: add 'struct gendisk' declaration Arnd Bergmann

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