From patchwork Wed Jan 14 22:55:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1503 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=1768431455; bh=je2dnkjeID6oqgTDXLPyvFDnFJXaYDXfYq1MobGOc1w=; 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=uBqG8/ABkZJ734WkH/SaCeU5fvZxjWsviY0rnx9ucKD82XRuRfnAMNeinMcBDobMJ bTclYwLXpUeTECkjbkjBqLi3o+JuXcYWBdAsqnNWFVGfExppQWivtq7LcqwvbCyQMw t7kr2d9aXQKed+883x5t3GMIRiUs2OTx2yLDecvwEN0I61UuBNDurIm/uiMvA3dFE1 llnFXqsFug5jmoTSBLvlks0CSuRLgzvsIo7FIfX2Nyhn20Jv/yQ1orVN+5zbqTQcsX Q9kYUD1klPuRR+Fa778OaI7GU9RusxvHAWAl806W483fkw+MxAGDiI/UF0Km73whhp AfWUkiwYK+opw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5EE7E69360 for ; Wed, 14 Jan 2026 15:57:35 -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 qe1dHOim1Tbe for ; Wed, 14 Jan 2026 15:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431455; bh=je2dnkjeID6oqgTDXLPyvFDnFJXaYDXfYq1MobGOc1w=; 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=uBqG8/ABkZJ734WkH/SaCeU5fvZxjWsviY0rnx9ucKD82XRuRfnAMNeinMcBDobMJ bTclYwLXpUeTECkjbkjBqLi3o+JuXcYWBdAsqnNWFVGfExppQWivtq7LcqwvbCyQMw t7kr2d9aXQKed+883x5t3GMIRiUs2OTx2yLDecvwEN0I61UuBNDurIm/uiMvA3dFE1 llnFXqsFug5jmoTSBLvlks0CSuRLgzvsIo7FIfX2Nyhn20Jv/yQ1orVN+5zbqTQcsX Q9kYUD1klPuRR+Fa778OaI7GU9RusxvHAWAl806W483fkw+MxAGDiI/UF0Km73whhp AfWUkiwYK+opw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B7316934D for ; Wed, 14 Jan 2026 15:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431453; bh=9jCMkg7iY4ebTNAZ9/smcVp6LV1abmOOquSZ8fTBsfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wJJZe9HDQngUF63UBwrezG3o+GgPidwdqRW4KkqZLL8DoEMd/pib3hl5tdx0uplJh QRDoEYUQL16aLPRXSUAS3lsMkvGePWcUHnxyLgbOVUxLWylHDvJEgT7HYU+c+bSs9R FMLvyUIIIEESQUq1HBECln+2Vl3Mcyu8UPc1DoCFpeKzFaydv/TELQCHQcDDK/brGF D+pmFThJlylPO1P0iSBiJrimkPUKC70xTOCxWpzUPLFfkJIAf8t/m063rjG9DTV+Iy UMpv3p1LKn5VykuCgLDlNdUAXj029I3qJAlshyYcs5bPI/oi1lyk0ITk92y0PdYP+b bDOaWCAA8GPxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC08069342; Wed, 14 Jan 2026 15:57:33 -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 9U7-mPDKU15l; Wed, 14 Jan 2026 15:57:33 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431449; bh=z9/YAYik58+1ppuOWOSsu7bDT4S0NBUT44EsY8xuNbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFoEKN0hgCjTeGarla9JKKaSe6+flagwje7nOqSsJccCKCRa0fiDCKVmqmG1TK2bV vK7ROYhOXibudqADpbA8FwgVe3U9S/sSLcLCAwz3yPS/J0cpyZuZoNiPZSCA1VbSTV kqHGHQxlqSbUY2sB0yTUcp8dIZLuwdrxOHuxb3q2sUUJr6rUhR8yT8qB1Z6578wsS6 pVZCMFKOCclCOrF1a8LpDSB7ld5nrOrSd1nzuuCyTYzoV3AgVYGxrGWl91EL/bQ1N7 G4A2zv2Nq/5mAxQLdUggAUauY5LUHS/gdbeqBgP5y2YhST/M6pHTVLQJ0pCqGirq8l K2x/sd2j4WizA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 58FDF692EF; Wed, 14 Jan 2026 15:57:29 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:59 -0700 Message-ID: <20260114225635.3407989-10-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: 36V5YCBV432TTPH5OAARD4PUPXRBAOLQ X-Message-ID-Hash: 36V5YCBV432TTPH5OAARD4PUPXRBAOLQ 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 09/34] ext4l: Use linux/completion.h for completion stubs 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 Remove the local 'struct completion' definition and the wait_for_completion() function from ext4lm using linux/completion.h instead. The header provides the same stub functionality via macros and static inline functions. Also fix linux/completion.h to use 'static inline' instead of just 'inline' for the U-Boot stub functions to prevent multiple definition errors when the header is included in multiple C files. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 +++----- fs/ext4l/stub.c | 5 +---- include/linux/completion.h | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index aee6938977d..16b0512781f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -126,10 +126,8 @@ struct lock_class_key { int dummy; }; #define rwsem_release(l, i) do { } while (0) #define _THIS_IP_ ((unsigned long)0) -/* completion - stub */ -struct completion { - unsigned int done; -}; +/* completion - use Linux header */ +#include /* Cache alignment - stub */ #define ____cacheline_aligned_in_smp @@ -2135,7 +2133,7 @@ void invalidate_bdev(struct block_device *bdev); /* Kobject - declarations for stub.c */ void kobject_put(struct kobject *kobj); -void wait_for_completion(struct completion *comp); +/* wait_for_completion is now a macro in linux/completion.h */ /* DAX - declaration for stub.c */ void fs_put_dax(void *dax, void *holder); diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index 2084faa3b50..6e16af2dc24 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -486,10 +486,7 @@ void kobject_put(struct kobject *kobj) { } -/* completion */ -void wait_for_completion(struct completion *comp) -{ -} +/* completion - now uses linux/completion.h macro */ /* DAX */ void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len, diff --git a/include/linux/completion.h b/include/linux/completion.h index 9835826d285..7336421ea84 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -129,39 +129,39 @@ extern void complete_all(struct completion *); #define wait_for_completion(x) do {} while (0) #define wait_for_completion_io(x) do {} while (0) -inline int wait_for_completion_interruptible(struct completion *x) +static inline int wait_for_completion_interruptible(struct completion *x) { return 1; } -inline int wait_for_completion_killable(struct completion *x) +static inline int wait_for_completion_killable(struct completion *x) { return 1; } -inline unsigned long wait_for_completion_timeout(struct completion *x, - unsigned long timeout) +static inline unsigned long wait_for_completion_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline unsigned long wait_for_completion_io_timeout(struct completion *x, - unsigned long timeout) +static inline unsigned long wait_for_completion_io_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline long wait_for_completion_interruptible_timeout(struct completion *x, - unsigned long timeout) +static inline long wait_for_completion_interruptible_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline long wait_for_completion_killable_timeout(struct completion *x, - unsigned long timeout) +static inline long wait_for_completion_killable_timeout(struct completion *x, + unsigned long timeout) { return 1; } -inline bool try_wait_for_completion(struct completion *x) +static inline bool try_wait_for_completion(struct completion *x) { return 1; } -inline bool completion_done(struct completion *x) +static inline bool completion_done(struct completion *x) { return 1; }