Skip to contentSkip to conversation

sbitmap, scsi/target: add seq_file forward declaration

PATCH Applied Arnd Bergmann 4 participants 4 messages Jul 6, 2018 – Jul 11, 2018 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sbitmap, scsi/target: add seq_file forward declaration

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

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

---
 include/linux/sbitmap.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/sbitmap.h +2 -0
index e6539536dea9..804a50983ec5 100644
@@ -23,6 +23,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 
+struct seq_file;
+
 /**
  * struct sbitmap_word - Word in a &struct sbitmap.
  */
Signature · 1 line
2.9.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 27 lines · Arnd Bergmann

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

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

---
 include/linux/sbitmap.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/sbitmap.h +0 -0
index e6539536dea9..804a50983ec5 100644

include/linux/sbitmap.h line 30

Quoted 8 lines
include/linux/sbitmap.h +2 -0
@@ -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 on v2 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

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);
                                              ^~~~~~~~
Quoted 6 lines

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")
Quoted 23 lines

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

---
 include/linux/sbitmap.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/sbitmap.h +2 -0
index e6539536dea9..804a50983ec5 100644
@@ -23,6 +23,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 
+struct seq_file;
+
 /**
  * struct sbitmap_word - Word in a &struct sbitmap.
  */
Signature · 1 line
2.9.0
#3 lore raw
In reply to Arnd Bergmann

Arnd,

Quoted 6 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering