lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] block: add another struct gendisk to <linux/blkdev.h>
Date
From: Randy Dunlap <rdunlap@infradead.org>

Add a forward declaration for struct gendisk when CONFIG_BLOCK is
not set/enabled to prevent multiple (30 - 50) build warnings.

In file included from ../kernel/sched/sched.h:39:0,
from ../kernel/sched/core.c:9:
../include/linux/blkdev.h:1895:41: warning: 'struct gendisk' declared inside parameter list will not be visible outside of this definition or declaration
unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
^~~~~~~

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
---
include/linux/blkdev.h | 1 +
1 file changed, 1 insertion(+)

--- linux-next-20200528.orig/include/linux/blkdev.h
+++ linux-next-20200528/include/linux/blkdev.h
@@ -1836,6 +1836,7 @@ static inline bool blk_req_can_dispatch_
#else /* CONFIG_BLOCK */

struct block_device;
+struct gendisk;

/*
* stubs for when the block layer is configured out
\
 
 \ /
  Last update: 2020-05-28 19:23    [W:0.035 / U:76.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site