[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47d87d9ca498687344fcb18067ffe5e7bc313616.camel@wdc.com>
Date: Fri, 6 Jul 2018 17:07:39 +0000
From: Bart Van Assche <Bart.VanAssche@....com>
To: "arnd@...db.de" <arnd@...db.de>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"felipe.balbi@...ux.intel.com" <felipe.balbi@...ux.intel.com>,
"willy@...radead.org" <willy@...radead.org>,
"paolo.valente@...aro.org" <paolo.valente@...aro.org>,
"ming.lei@...hat.com" <ming.lei@...hat.com>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"osandov@...com" <osandov@...com>,
"jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>
Subject: Re: [PATCH] sbitmap, scsi/target: add seq_file forward declaration
On Fri, 2018-07-06 at 15:23 +0200, Arnd Bergmann wrote:
> The target core runs into a warning in the linux/sbitmap.h
> file in some configurations:
>
> In file included from include/target/target_core_base.h:7,
> from drivers/target/target_core_fabric_lib.c:41:
> include/linux/sbitmap.h:331:46: error: 'struct seq_file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
> void sbitmap_show(struct sbitmap *sb, struct seq_file *m);
> ^~~~~~~~
>
> In general, headers should not depend on others being included first,
> so this fixes it with a forward declaration for that struct name, but
> we probably want to merge the patch through the scsi tree to help
> bisection.
>
> Fixes: 10e9cbb6b531 ("scsi: target: Convert target drivers to use sbitmap")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> include/linux/sbitmap.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h
> index e6539536dea9..cc54b9f7ff8b 100644
> --- a/include/linux/sbitmap.h
> +++ b/include/linux/sbitmap.h
> @@ -321,6 +321,8 @@ static inline int sbitmap_test_bit(struct sbitmap *sb, unsigned int bitnr)
>
> unsigned int sbitmap_weight(const struct sbitmap *sb);
>
> +struct seq_file;
> +
> /**
> * sbitmap_show() - Dump &struct sbitmap information to a &struct seq_file.
> * @sb: Bitmap to show.
In many Linux kernel header files all forward declarations are grouped near
the start of the header file (after #includes and #defines and before structure
definitions). Should we follow that pattern in <linux/sbitmap.h>?
Thanks,
Bart.
Powered by blists - more mailing lists