diff mbox series

[v2] sbitmap, scsi/target: add seq_file forward declaration

Message ID 20180706201920.2185565-1-arnd@arndb.de
State New
Headers show
Series [v2] sbitmap, scsi/target: add seq_file forward declaration | expand

Commit Message

Arnd Bergmann July 6, 2018, 8:19 p.m. UTC
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@arndb.de>

---
v2: move declaration to the start of the header, as suggested by Bart
---
 include/linux/sbitmap.h | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.9.0

Comments

Bart Van Assche July 6, 2018, 8:33 p.m. UTC | #1
On Fri, 2018-07-06 at 22:19 +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@arndb.de>

> ---

> v2: move declaration to the start of the header, as suggested by Bart

> ---

>  include/linux/sbitmap.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h

> index e6539536dea9..804a50983ec5 100644

> --- a/include/linux/sbitmap.h

> +++ b/include/linux/sbitmap.h

> @@ -23,6 +23,8 @@

>  #include <linux/kernel.h>

>  #include <linux/slab.h>

>  

> +struct seq_file;

> +

>  /**

>   * struct sbitmap_word - Word in a &struct sbitmap.

>   */


Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Omar Sandoval July 6, 2018, 8:58 p.m. UTC | #2
On Fri, Jul 06, 2018 at 10:19:07PM +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")


Reviewed-by: Omar Sandoval <osandov@fb.com>


> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

> v2: move declaration to the start of the header, as suggested by Bart

> ---

>  include/linux/sbitmap.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h

> index e6539536dea9..804a50983ec5 100644

> --- a/include/linux/sbitmap.h

> +++ b/include/linux/sbitmap.h

> @@ -23,6 +23,8 @@

>  #include <linux/kernel.h>

>  #include <linux/slab.h>

>  

> +struct seq_file;

> +

>  /**

>   * struct sbitmap_word - Word in a &struct sbitmap.

>   */

> -- 

> 2.9.0

>
Martin K. Petersen July 11, 2018, 2:54 a.m. UTC | #3
Arnd,

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


Applied to 4.19/scsi-queue, thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h
index e6539536dea9..804a50983ec5 100644
--- a/include/linux/sbitmap.h
+++ b/include/linux/sbitmap.h
@@ -23,6 +23,8 @@ 
 #include <linux/kernel.h>
 #include <linux/slab.h>
 
+struct seq_file;
+
 /**
  * struct sbitmap_word - Word in a &struct sbitmap.
  */