Skip to contentSkip to conversation

blk-mq: kill warning when building block/blk-mq-debugfs-zoned.c

PATCH In review Ming Lei 3 participants 4 messages Mar 2, 2022 – Mar 9, 2022 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH v2 1/1 blk-mq: kill warning when building block/blk-mq-debugfs-zoned.c

Fix the following warning when building block/blk-mq-debugfs-zoned.c:

In file included from block/blk-mq-debugfs-zoned.c:7:
block/blk-mq-debugfs.h:24:14: warning: ‘struct blk_mq_hw_ctx’ declared inside parameter list will not be visible outside of this definition or declaration

   24 |       struct blk_mq_hw_ctx *hctx);
      |              ^~~~~~~~~~~~~

---
V2:
- forward declaration of struct blk_mq_hw_ctx instead of including header, as suggested by Christoph

 block/blk-mq-debugfs.h | 2 ++
 1 file changed, 2 insertions(+)
block/blk-mq-debugfs.h +2 -0
index a68aa6041a10..361d759c6fad 100644
@@ -2,6 +2,8 @@
 #ifndef INT_BLK_MQ_DEBUGFS_H
 #define INT_BLK_MQ_DEBUGFS_H
 
+struct blk_mq_hw_ctx;
+
 #ifdef CONFIG_BLK_DEBUG_FS
 
 #include <linux/seq_file.h>
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Ming Lei

Fix the following warning when building block/blk-mq-debugfs-zoned.c:

In file included from block/blk-mq-debugfs-zoned.c:7:
block/blk-mq-debugfs.h:24:14: warning: ‘struct blk_mq_hw_ctx’ declared inside parameter list will not be visible outside of this definition or declaration

    24 |       struct blk_mq_hw_ctx *hctx);
       |              ^~~~~~~~~~~~~

---

Looks good.

-ck

author
#3 lore raw
In reply to Ming Lei
Quoted 7 lines · Ming Lei

Fix the following warning when building block/blk-mq-debugfs-zoned.c:

In file included from block/blk-mq-debugfs-zoned.c:7:
block/blk-mq-debugfs.h:24:14: warning: ‘struct blk_mq_hw_ctx’ declared inside parameter list will not be visible outside of this definition or declaration

   24 |       struct blk_mq_hw_ctx *hctx);
      |              ^~~~~~~~~~~~~
Quoted 7 lines

---
V2:
- forward declaration of struct blk_mq_hw_ctx instead of including header, as suggested by Christoph

Hello Jens,

This patch looks missed, can you take a look?

Thanks,
Ming