[PATCH] mtd: concat: include <linux/mtd/mtd.h>

Julius Bairaktaris julius at bairaktaris.de
Sun Nov 29 13:22:42 PST 2026


Since commit 59509da0cb51 ("mtd: Move struct mtd_concat definition to
header file"), <linux/mtd/concat.h> embeds a struct mtd_info in struct
mtd_concat, and its declarations use bool, but the header includes
nothing. It builds only after <linux/mtd/mtd.h> has been included; a
file that includes concat.h first fails with

  include/linux/mtd/concat.h:19:25: error: field 'mtd' has incomplete type

Include <linux/mtd/mtd.h> in the header so it can be included on its
own.

Signed-off-by: Julius Bairaktaris <julius at bairaktaris.de>
---

Notes:
    Found when OpenWrt's out-of-tree mtd-concat driver, which includes
    concat.h before mtd.h, stopped building on v7.4. All six in-tree users
    include <linux/mtd/mtd.h> first, so no in-tree build fails, and the
    patch carries no Fixes tag. A file that includes only
    <linux/mtd/concat.h> fails to build on mtd/next with the error above
    and "unknown type name 'bool'". With this patch it builds without
    warnings at W=1 for arm64 and for UML x86_64, and so do mtdconcat.c,
    mtd_virt_concat.c, mtdcore.c and mtdpart.c for arm64.
    I used Claude (Anthropic) to help write these patches.

 include/linux/mtd/concat.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h
index f8d4d6ac1..337769b4f 100644
--- a/include/linux/mtd/concat.h
+++ b/include/linux/mtd/concat.h
@@ -8,6 +8,7 @@
 #ifndef MTD_CONCAT_H
 #define MTD_CONCAT_H
 
+#include <linux/mtd/mtd.h>
 
 /*
  * Our storage structure:

base-commit: b3b86fbd14b98c6a1786308ba0ecd666827dcb0e
-- 
2.53.0




More information about the linux-mtd mailing list