From patchwork Wed Jan 14 22:56:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1511 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431488; bh=1SiEvfyMvA/Nq/HuuSLiBXwS0nv3hWK3WbKfoteoFM0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=m5JcyeLgXO3kwmF1dB0jMt80U2+B5EV+WqsFDhLzAWODl+g90OLI6A5GaDj4bvvvF L1lzSRAH46v9k6g2m86xiTGpPr3NJPE9U0VyV1VsdvcN2dhLySOTWJZA7P32R7Mcdr +ees9aznlWNQJ2AAE9iA2Ehx7NhN0FT5W3ZjFWrUc77EYksNjUtZA6/VnUEbu+NoCy 2eNrHb6P3/eJLq+0ohLgD7Z6FKd+uwMaXWJ3obbAr3du7JqiF4L2rTZrhqUvKO1gBD BHFNqkCLkYUeLiF55FFboACxtPHtj0k0yuH8fIChzy2b100blaYb+NEmKP1/2aO3rk ixvN4G2dxCq0Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3408B692E6 for ; Wed, 14 Jan 2026 15:58:08 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id R3fWXKl8m536 for ; Wed, 14 Jan 2026 15:58:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431488; bh=1SiEvfyMvA/Nq/HuuSLiBXwS0nv3hWK3WbKfoteoFM0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=m5JcyeLgXO3kwmF1dB0jMt80U2+B5EV+WqsFDhLzAWODl+g90OLI6A5GaDj4bvvvF L1lzSRAH46v9k6g2m86xiTGpPr3NJPE9U0VyV1VsdvcN2dhLySOTWJZA7P32R7Mcdr +ees9aznlWNQJ2AAE9iA2Ehx7NhN0FT5W3ZjFWrUc77EYksNjUtZA6/VnUEbu+NoCy 2eNrHb6P3/eJLq+0ohLgD7Z6FKd+uwMaXWJ3obbAr3du7JqiF4L2rTZrhqUvKO1gBD BHFNqkCLkYUeLiF55FFboACxtPHtj0k0yuH8fIChzy2b100blaYb+NEmKP1/2aO3rk ixvN4G2dxCq0Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 21C3D69345 for ; Wed, 14 Jan 2026 15:58:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431486; bh=nlLs/i6GvCPXdE6l3hpoNWfGjz8OOZBFac6IKXIc78g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vkhlhk3vuHIxywjL7da3z23E4+YFlyvr/y/b8URFEAaL8Uq7rUGCmiy+QSCckecff gbON3lCyAxYRDNmwKsWmG7Mc6b++UHLvIfDvI99xnyM+shFGCDXuvkLFRCN18NnfFu QF7kd2eyTVHT/ilHqO/Ln6qtoZh2wZNdkLS6PhvW2ATPJTnr4Cs/mj9J6ZO799kbcw ETH+IEm8c/G5PWzFkJgrYKVq1nJEWCqzrSQFz3FHrnUgasett3NU6JlykYl+GX7CB6 2Y4e50ix4pbOsqhkVqWQaS+Eb6aE4vVaMStXH/Flo5KUrmEPrg4Sn7Fmv9ClexH8H0 sTLbIw2MV1aig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DEFFC692E6; Wed, 14 Jan 2026 15:58:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ZAIPnB6fMugc; Wed, 14 Jan 2026 15:58:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431482; bh=ggBtWVo4hi1dnWxkQ1eJ0n+87GG4GW4UMj1/YyPs4Yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IaIgkR39zfCL2KqL7oDsJOGOM0SCZq/SoY9sc4HvTCcElMTmeHIj4NXMsVW5hTk7E 6H4u/KDNq5eWc/JlufQlbFdznQhRuQSis3YlTaHrJ4qsRiuWu9BqRkoO4J5KIHgC+o igXCxftJ6TlhcA3KpoEcrF8q+VmNUogVM94TFpyBAfNd/egKAiUcAkyHbyhDDVSldY OGb5clbXv0lJXi1jjelY9/RkBOBtcEN092LemQXdq4gw/tQFJix5g1HGCrgbLUVns8 4ALo1esEG6cBLycg/jsbj3Cvfrew2mxoJV5v3LSFc1f9JwhPvDDxA4yHgV/6FIR+xM FNijNwzIvb0aA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8D9CF6935F; Wed, 14 Jan 2026 15:58:02 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:07 -0700 Message-ID: <20260114225635.3407989-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LIPD2JHGJDCUKZ3ZCJ53TFZXULQM7MXB X-Message-ID-Hash: LIPD2JHGJDCUKZ3ZCJ53TFZXULQM7MXB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/34] ext4l: Move seq_file definitions to linux/seq_file.h List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move struct seq_operations and SEQ_START_TOKEN to linux/seq_file.h where they belong, following standard Linux header organisation. Also move GFP_NOIO to linux/slab.h with the other GFP flags, and remove the redundant bh_end_io_t typedef since it is already defined in linux/buffer_head.h Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 28 ++++++---------------------- include/linux/seq_file.h | 13 +++++++++++++ include/linux/slab.h | 3 +++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index b13e653c883..3cc37f65dda 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -524,11 +524,7 @@ typedef long long qsize_t; /* blk_opf_t - block operation flags */ typedef unsigned int blk_opf_t; -/* Forward declare buffer_head for bh_end_io_t */ -struct buffer_head; - -/* bh_end_io_t - buffer head end io callback */ -typedef void bh_end_io_t(struct buffer_head *bh, int uptodate); +/* bh_end_io_t and struct buffer_head are in linux/buffer_head.h */ /* Directory entry types */ #define DT_UNKNOWN 0 @@ -919,9 +915,7 @@ struct dx_hash_info { #define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) /* jbd2_buffer_trigger_type is defined in jbd2.h */ - -/* seq_file - forward declaration */ -struct seq_file; +/* struct seq_file is in linux/seq_file.h */ /* fscrypt_has_encryption_key, fscrypt_fname_siphash are in ext4_fscrypt.h */ @@ -1151,8 +1145,7 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) int name __attribute__((unused)) = 0 #define __ratelimit(state) ({ (void)(state); 1; }) -/* seq_file tokens */ -#define SEQ_START_TOKEN ((void *)1) +/* SEQ_START_TOKEN is in linux/seq_file.h */ /* folio - memory page container stub */ struct folio { @@ -1874,8 +1867,7 @@ struct kstatfs { long f_spare[4]; }; -/* seq_file stubs */ -struct seq_file; +/* struct seq_file is in linux/seq_file.h */ /* Module stubs */ struct module; @@ -2339,13 +2331,7 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* pde_data - proc dir entry data (not supported in U-Boot) */ #define pde_data(inode) ((void *)NULL) -/* seq_operations for procfs iteration */ -struct seq_operations { - void *(*start)(struct seq_file *m, loff_t *pos); - void (*stop)(struct seq_file *m, void *v); - void *(*next)(struct seq_file *m, void *v, loff_t *pos); - int (*show)(struct seq_file *m, void *v); -}; +/* struct seq_operations is in linux/seq_file.h */ /* DEFINE_RAW_FLEX - define a flexible array struct on the stack (stubbed to NULL) */ #define DEFINE_RAW_FLEX(type, name, member, count) \ @@ -2462,9 +2448,7 @@ struct folio_iter { #define blk_status_to_errno(status) (-(status)) /* atomic_inc is in asm-generic/atomic.h */ - -/* GFP_NOIO - allocation without I/O */ -#define GFP_NOIO 0 +/* GFP_NOIO is in linux/slab.h */ /* fscrypt page-io stubs are in ext4_fscrypt.h */ diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index e4139f48e16..c10da3e4f98 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -2,6 +2,8 @@ #ifndef _LINUX_SEQ_FILE_H #define _LINUX_SEQ_FILE_H +#include + /* * Stub definitions for seq_file interface. * U-Boot doesn't use /proc filesystem. @@ -12,6 +14,17 @@ struct seq_file { struct file *file; }; +/* seq_operations for procfs iteration */ +struct seq_operations { + void *(*start)(struct seq_file *m, loff_t *pos); + void (*stop)(struct seq_file *m, void *v); + void *(*next)(struct seq_file *m, void *v, loff_t *pos); + int (*show)(struct seq_file *m, void *v); +}; + +/* SEQ_START_TOKEN for iteration start marker */ +#define SEQ_START_TOKEN ((void *)1) + #define seq_printf(m, fmt, ...) do { (void)(m); } while (0) #define seq_puts(m, s) do { (void)(m); (void)(s); } while (0) #define seq_putc(m, c) do { (void)(m); (void)(c); } while (0) diff --git a/include/linux/slab.h b/include/linux/slab.h index 2b374641534..f0c0add0cbd 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -42,6 +42,9 @@ #ifndef __GFP_NOFAIL #define __GFP_NOFAIL ((gfp_t)0) #endif +#ifndef GFP_NOIO +#define GFP_NOIO ((gfp_t)0) +#endif void *kmalloc(size_t size, gfp_t flags);