From patchwork Tue Jan 20 23:43:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1715 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=1768952687; bh=Axss7PPHLQc2R8wPNlanOUAPP/8UrpFcP8aPofDuHOw=; 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=RtcY9HsOZ/eAoZOde4P3xgL0RPCJBenLWVlOsc3ihjPfpkyc18NBYVddQc3SnChIC ufyKpDhWMMHxuUwyRoL1fi8XLv9Xrpp9AOihek+hBOIvBddChBBBPv73KILn32Uzgn MnVwP7sACjfNTdRQB9bZChf7CmuS6EpTHc1hsntgsAaK2nlBedIBaljigI/dy4V0gt spxElP8CdG/zuQsc9JQUqTGrrDQQhlOnhhe23azwgl1tjh4PaR2XCFDudllQTTtEu1 PSfmv8VupRwSrCvMCLtFfLsrTzE06Y72KrfaVeiKx5qOOw3FSjym9qfk5uSBpWejOM Fd4WJhuBxG6Ug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5687695AE for ; Tue, 20 Jan 2026 16:44:47 -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 hlzf7n1AUDyz for ; Tue, 20 Jan 2026 16:44:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952687; bh=Axss7PPHLQc2R8wPNlanOUAPP/8UrpFcP8aPofDuHOw=; 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=RtcY9HsOZ/eAoZOde4P3xgL0RPCJBenLWVlOsc3ihjPfpkyc18NBYVddQc3SnChIC ufyKpDhWMMHxuUwyRoL1fi8XLv9Xrpp9AOihek+hBOIvBddChBBBPv73KILn32Uzgn MnVwP7sACjfNTdRQB9bZChf7CmuS6EpTHc1hsntgsAaK2nlBedIBaljigI/dy4V0gt spxElP8CdG/zuQsc9JQUqTGrrDQQhlOnhhe23azwgl1tjh4PaR2XCFDudllQTTtEu1 PSfmv8VupRwSrCvMCLtFfLsrTzE06Y72KrfaVeiKx5qOOw3FSjym9qfk5uSBpWejOM Fd4WJhuBxG6Ug== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B4469695A6 for ; Tue, 20 Jan 2026 16:44:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952685; bh=zx/TUUch3FwICodDBs4lD9q+O9lhQ/YHVLJ1b94T4Vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ASOIgNNZnvNRQ2vuYBdksT9VVoeItbZZodQ69jX+VTxbICP+4ru4keGc2Hzg+AhSl fHKSEO1atmnBSJih5AoVAbHpzjnWOoEPqLpo6W1fJorj+d2Sj9CAD8ZQ00d8i4qWS5 r2GhL7cc7QveM+TyFBWYc5s1jZ1zfDaFtPinXqk+sphTAwh8YrYShUr5xtLlEJJr+D pgYlNCI8clIt02l1GMShrebICCvfnguikG8jFfBmfvw+S7iAy6a7utH82xkyljSzr0 Wee1Ic+eIsQqCGQlMhyPpZjgjdp8tqwskVd8odkCHxSu880z4EXZXh+tgfvwFjqPvl SM22ZRGGWWGpA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C8DD69597; Tue, 20 Jan 2026 16:44:45 -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 IRGF4FEOIi_Q; Tue, 20 Jan 2026 16:44:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768952681; bh=xofiKXHk+36VVe2YzAX0CNp86PbQ9T7WURoNfK63QEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=htzZNp7Gtlnob2WHeLkuorq1EU/O7Ex7whzAzOHYDuw2TFI19gC3ITuKv5uMV/vuC xGbRCaW0/VXFXNn8Hb0Xc+klQcaA1XEwWT7CgrnNbQeP8WOgcyjBx5jqhAZZ1Wszg8 5Iqx5cBEP4/TBQyAZ0exNcGiBn+gfeyRiJ30Xa/aJSXGCvGdKIglhjU1foGi6gLSkO PIZc1EYIAcmvvS9MFldUS947tx2YmZcrr2vQ3CM+lK5seTyjS5W6r3dqdbfbOo3K9n HdMYC72RmoPsUefJRS2WA4V+RXWLjXV6cVoslux60+RT7NLRRVDKpmWp+8Pm8brkbQ vWk6/TJsTTxdQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0FD6469555; Tue, 20 Jan 2026 16:44:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:43:26 -0700 Message-ID: <20260120234344.495605-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120234344.495605-1-sjg@u-boot.org> References: <20260120234344.495605-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HYRKXR6JARL3Z7SEHI7CQT4DK5XCYAHP X-Message-ID-Hash: HYRKXR6JARL3Z7SEHI7CQT4DK5XCYAHP 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 06/17] ext4l: Move uuid_to_fsid to linux/statfs.h and use hexdump.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 uuid_to_fsid() to linux/statfs.h where it belongs in the Linux kernel header hierarchy. Also use hexdump.h for DUMP_PREFIX_* types, with a stub for print_hex_dump since the Linux kernel has a different function signature than U-Boot. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 21 ++++++++------------- include/linux/statfs.h | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 6f2ea69a888..09e58989888 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1003,8 +1003,13 @@ static u64 __attribute__((unused)) __ext4_sectors[2]; /* system_state, SYSTEM_HALT, etc. are in linux/kernel.h */ -/* Hex dump */ -#define DUMP_PREFIX_ADDRESS 0 +/* + * Hex dump - DUMP_PREFIX_* types are in hexdump.h. + * However, the Linux kernel print_hex_dump has a different signature + * (includes log level) than U-Boot's, so we stub it out here. + */ +#include +#undef print_hex_dump #define print_hex_dump(l, p, pt, rg, gc, b, len, a) do { } while (0) /* SLAB_RECLAIM_ACCOUNT, SLAB_ACCOUNT are in linux/slab.h */ @@ -1037,17 +1042,7 @@ struct super_operations { /* export_operations and fid - use linux/exportfs.h */ #include -/* uuid_to_fsid - convert UUID to fsid */ -static inline __kernel_fsid_t uuid_to_fsid(const u8 *uuid) -{ - __kernel_fsid_t fsid; - - fsid.val[0] = (uuid[0] << 24) | (uuid[1] << 16) | - (uuid[2] << 8) | uuid[3]; - fsid.val[1] = (uuid[4] << 24) | (uuid[5] << 16) | - (uuid[6] << 8) | uuid[7]; - return fsid; -} +/* uuid_to_fsid is in linux/statfs.h */ /* kstatfs - use linux/statfs.h */ #include diff --git a/include/linux/statfs.h b/include/linux/statfs.h index bdc3f9b9e87..6ba93c5b292 100644 --- a/include/linux/statfs.h +++ b/include/linux/statfs.h @@ -39,4 +39,23 @@ struct kstatfs { long f_spare[4]; }; +/** + * uuid_to_fsid - convert UUID to filesystem ID + * @uuid: UUID to convert (at least 8 bytes) + * + * Converts the first 8 bytes of a UUID to a filesystem ID. + * + * Return: the filesystem ID + */ +static inline __kernel_fsid_t uuid_to_fsid(const u8 *uuid) +{ + __kernel_fsid_t fsid; + + fsid.val[0] = (uuid[0] << 24) | (uuid[1] << 16) | + (uuid[2] << 8) | uuid[3]; + fsid.val[1] = (uuid[4] << 24) | (uuid[5] << 16) | + (uuid[6] << 8) | uuid[7]; + return fsid; +} + #endif /* _LINUX_STATFS_H */