[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251023082142.2104456-1-linux@rasmusvillemoes.dk>
Date: Thu, 23 Oct 2025 10:21:42 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-kbuild@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
David Sterba <dsterba@...e.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH] fs/pipe: stop duplicating union pipe_index declaration
Now that we build with -fms-extensions, union pipe_index can be
included as an anonymous member in struct pipe_inode_info, avoiding
the duplication.
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
Do we want to do this as well? At the very least it would give some
more test coverage if this could be in -next for most of a cycle.
Context for new people:
https://lore.kernel.org/lkml/CAHk-=wjeZwww6Zswn6F_iZTpUihTSNKYppLqj36iQDDhfntuEw@mail.gmail.com/
https://lore.kernel.org/linux-kbuild/20251020142228.1819871-1-linux@rasmusvillemoes.dk/
include/linux/pipe_fs_i.h | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 9d42d473d201..80539972e569 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -44,12 +44,6 @@ typedef unsigned int pipe_index_t;
typedef unsigned short pipe_index_t;
#endif
-/*
- * We have to declare this outside 'struct pipe_inode_info',
- * but then we can't use 'union pipe_index' for an anonymous
- * union, so we end up having to duplicate this declaration
- * below. Annoying.
- */
union pipe_index {
unsigned long head_tail;
struct {
@@ -87,14 +81,7 @@ struct pipe_inode_info {
struct mutex mutex;
wait_queue_head_t rd_wait, wr_wait;
- /* This has to match the 'union pipe_index' above */
- union {
- unsigned long head_tail;
- struct {
- pipe_index_t head;
- pipe_index_t tail;
- };
- };
+ union pipe_index;
unsigned int max_usage;
unsigned int ring_size;
base-commit: 778740ee2d00e5c04d0c8ffd9c3beea89b1ec554
--
2.51.0
Powered by blists - more mailing lists