From patchwork Mon Jan 19 21:48:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1661 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=1768859360; bh=dUykpEd0XLlQIvO83NPnWsJcCHic1fjRV/L0oxi/CDI=; 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=JqXZvafbAJ1us+Lk96ZWO161F2LJsiMrU26n/nfbB4v/R2zNK5X/SxIOwaAcokjh1 tPxTsBWl83vSEXW3cBS2YOQolqgH4btnVP+xgaYWF+0N09Lo8809Mds93GMjcixX1R /A+dDyPB+5b3PEapQ1i1011Q1xCVxEZkBIIbn129OYVobv/R/8PTZWIBv/XFGYUkDf 70dP/aWf1TTGE/rK54b0NXwhZIrFwsNhvXeAMnAQFJJY89oeZGM2Aho2QIGEvvUACC QBSlrgLqapWR9KhbhwkZm4LmdRdGGW9hVZgOruLWrqEyCW6D74FwXc7Rs9DCCtIcIT dBaqCWe14cZvw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 41E2E69536 for ; Mon, 19 Jan 2026 14:49:20 -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 l6qLIz09b-po for ; Mon, 19 Jan 2026 14:49:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859360; bh=dUykpEd0XLlQIvO83NPnWsJcCHic1fjRV/L0oxi/CDI=; 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=JqXZvafbAJ1us+Lk96ZWO161F2LJsiMrU26n/nfbB4v/R2zNK5X/SxIOwaAcokjh1 tPxTsBWl83vSEXW3cBS2YOQolqgH4btnVP+xgaYWF+0N09Lo8809Mds93GMjcixX1R /A+dDyPB+5b3PEapQ1i1011Q1xCVxEZkBIIbn129OYVobv/R/8PTZWIBv/XFGYUkDf 70dP/aWf1TTGE/rK54b0NXwhZIrFwsNhvXeAMnAQFJJY89oeZGM2Aho2QIGEvvUACC QBSlrgLqapWR9KhbhwkZm4LmdRdGGW9hVZgOruLWrqEyCW6D74FwXc7Rs9DCCtIcIT dBaqCWe14cZvw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 30D6169533 for ; Mon, 19 Jan 2026 14:49:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859358; bh=ucR3QNo1vw4Hai4uKDslkhB2uoCPD14fPYFhT1FwAIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B1X8fZ6UdDEBMuJYoRTSWmtOk4/9YsPVxVKiBYhnFbpUtG/2qnNRHOZLLtjBG6M1z PB4az9BvPMhi1HE7dGItiiCm+1l2t5cH13xsaVhavIke/UFfo6JKw5YobFStOUeGsf O8GieNBq70MGDlCk34/UXG7C0xOQtWMroz6Yw+dE1CAQaRYYQE8pwC2Kxak7MQhZLs VK/8yOhNev9TxLk6sk9BUZSm3mQbqJbLWxd0Oz8uwJQT5qPkCtFCnwH9B+ZREJkwv4 5m6aBiPhXUawD/RUlPUdzWQDjx9KXyhx+6P7xkAMzx8oP5RQt/1vDGLl6qvmbVQAII Qdy9Yjn6Z3fhA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E5B469525; Mon, 19 Jan 2026 14:49:18 -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 pJbUv2R4UpQ7; Mon, 19 Jan 2026 14:49:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859354; bh=qV75VYdtmUfRhM6fKpZyK48oQ8XVZxFdhojWiGWCGVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iz1JLa8UICJfzro8vhtXhzzK6KTpZLqR7y496cuIQwZjRJjAAOWs82oq/s7meY23Z mhZxrnExBhW+DNDtURCaBj+7tmfiBVGtkOdPJ/4izm7HbkjY9dqoxwkBDCgZMuqTmW GyehdlHr/M5EHiKI4vWF9jegCOS2C2aKzBbD44S4Pbv5RmJaEDsUgu51XnAGGYU8qa 1/+8+I61uDIoIWmJ2pYcu3X0si8+MJn8264rQPGrVe9+iu4H7GyJmJAO2bSCfZYTZ5 CbKyAkUBS9Kdr2o74McRWWKQ6yr8/U2V2xdV4+Mp5yOiKfFeAgs/UOQptJU7vix4g8 KnvAILqoVXIMg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E55066951A; Mon, 19 Jan 2026 14:49:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:29 -0700 Message-ID: <20260119214846.3087611-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NEPN3HUMHBLP4EX7IJTKYV6MDAOKWGXN X-Message-ID-Hash: NEPN3HUMHBLP4EX7IJTKYV6MDAOKWGXN 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 04/16] ext4l: Move data_race, might_sleep, fallthrough to standard headers 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 data_race() to linux/compiler.h and might_sleep() to linux/kernel.h where they belong. The fallthrough attribute is already provided by linux/compiler_attributes.h, so just remove the duplicate definition. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 10 +++------- include/linux/compiler.h | 8 ++++++++ include/linux/kernel.h | 8 ++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 0b3b2d6f2e5..564e63d6882 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -123,7 +123,7 @@ /* Pointer check macros */ #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= PAGE_SIZE) -#define data_race(expr) (expr) +/* data_race is in linux/compiler.h */ /* REQ_META, REQ_PRIO, REQ_RAHEAD are in linux/blk_types.h */ /* __GFP_MOVABLE, __GFP_FS are in linux/slab.h */ @@ -191,8 +191,7 @@ extern struct user_namespace init_user_ns; #define BUG_ON(cond) do { (void)(cond); } while (0) #define BUG() do { } while (0) -/* might_sleep - stub */ -#define might_sleep() do { } while (0) +/* might_sleep is in linux/kernel.h */ /* sb_rdonly is in linux/super.h */ @@ -642,10 +641,7 @@ struct dx_hash_info { do { } while (0) #endif -/* fallthrough annotation */ -#ifndef fallthrough -#define fallthrough __attribute__((__fallthrough__)) -#endif +/* fallthrough is in linux/compiler_attributes.h */ /* BUILD_BUG_ON is in linux/build_bug.h */ /* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 09cea0e95e2..c1131fe886b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -352,4 +352,12 @@ static inline void *offset_to_ptr(const int *off) /* &a[0] degrades to a pointer: a different type from an array */ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) +/* + * data_race - mark data race intentional + * + * In U-Boot (single-threaded), no actual data races are possible, + * so just evaluate the expression. + */ +#define data_race(expr) (expr) + #endif /* __LINUX_COMPILER_H */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d6cd54f20b9..0da0d4915ec 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -313,4 +313,12 @@ enum system_states { #define system_state SYSTEM_RUNNING +/* + * might_sleep - indicate that a function may sleep + * + * U-Boot is single-threaded and doesn't have a scheduler, so this is a no-op. + */ +#define might_sleep() do { } while (0) +#define might_sleep_if(cond) do { } while (0) + #endif