From patchwork Wed Jan 21 22:08:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1743 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=1769033420; bh=a4kx/qAq3bOB8LPi1FFVN3k7HDhW9JtpDHHCNMxjJy8=; 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=wC8o8CoerE9Ali2mBjaoGHox+M/Qgnnj1OCU72yaGXIN7PbNu5XWuXhOjrMLzVfeg k+0BC8lGwBoge3uZIQqNeiyXoQrYuPWKtj7V58Aqj4qFtYARE6js9erMMA2zLwnRO0 xPzvkiPbyn13V2jYeyZ9IbFxJ8vdqGhfGP2crLE4M/giApVS4RUwOFUq6FxdJQrjrz NQ+apnmRq6YCFkCDE3VSAcxhdin0l2sD8dI86xXQGa+rHMMQL96g7QcOIrZM8CtHSZ E3hh73n0lnZu4AED+vsKodzft8aaaSHCdiovjONBc4Ir2fKxPZe/ETfG7DJ28IMYBV AQ8sRXCM0r5IA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 795B16960A for ; Wed, 21 Jan 2026 15:10: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 V11KjeGEVeRT for ; Wed, 21 Jan 2026 15:10:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033420; bh=a4kx/qAq3bOB8LPi1FFVN3k7HDhW9JtpDHHCNMxjJy8=; 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=wC8o8CoerE9Ali2mBjaoGHox+M/Qgnnj1OCU72yaGXIN7PbNu5XWuXhOjrMLzVfeg k+0BC8lGwBoge3uZIQqNeiyXoQrYuPWKtj7V58Aqj4qFtYARE6js9erMMA2zLwnRO0 xPzvkiPbyn13V2jYeyZ9IbFxJ8vdqGhfGP2crLE4M/giApVS4RUwOFUq6FxdJQrjrz NQ+apnmRq6YCFkCDE3VSAcxhdin0l2sD8dI86xXQGa+rHMMQL96g7QcOIrZM8CtHSZ E3hh73n0lnZu4AED+vsKodzft8aaaSHCdiovjONBc4Ir2fKxPZe/ETfG7DJ28IMYBV AQ8sRXCM0r5IA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 679F369605 for ; Wed, 21 Jan 2026 15:10:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033418; bh=RxwaLJTVobCjsJsxpBPkw1Ua8ZBih9VAg1FSY5Cowz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KcaY9jnx9BEOyTeOm1lonquNByBKqSB+VuTm50tW5IUOZe9/TskmTLpW+G+pWgdzN PYWVC2am3KDT3bnhmv6GOfJfO8/i3qtGtaRyAL89/Dn2szxGLxF6vCvWJpUoS5eACE YRyZH8pZu3XnL21MnnJwcKR4IqPovQD3/4JDTowijk4al8abND4EXhlpHVMMptxnd+ W119jfVXGK6w/TH7lG34E98j8P5W1bwlHR+g86yK9uxNzel8FMSRpcgv3X4/ZFFE99 9iswr2yWHQ91ERoHm1zpVatV2nbeKwKU8p0ygMbWPd85Bf0v2nwTlTSM44TSksUSoS bb9d+9opexY1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 75DAF695FB; Wed, 21 Jan 2026 15:10: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 K9i2h7ZCDnAe; Wed, 21 Jan 2026 15:10:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769033411; bh=yh7mxZbykiGqcFhopOAuSuFBPLhis9WAE7li8AcUrsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPzVOuomyefJAKIcA6CyLXuo3m3/1XybVIZcA35JElVrefCLaCa0jAqVU9zSGTHne 6ReybqQD/Ic4hPL+rMQjfM2zijWBBIu1WqVIIRPXxNo0gDtUwfdHVCeuvsjd7CFLxk 0+mTKKRYPXK/g05xdP2Lj82Tp4F3HN5F4ChLaaFnhSpO1yLlCYZE1vWsl33VIfOyux rO6gIw23EXHhnsIOMndNhQSZnYq5ssP6w7H+g1un/4H4Uc7+Aj4i18oR0BNnf02pW4 mVXkKjhbMPwGix9Ki4U1KVMVqgoPcS4eRWriGuwmIW4cOiouBQFFvbMp/TntUOzZw5 7XgMBAuWHaO7g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1141E695F2; Wed, 21 Jan 2026 15:10:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 15:08:30 -0700 Message-ID: <20260121220857.2137568-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260121220857.2137568-1-sjg@u-boot.org> References: <20260121220857.2137568-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XXWMY5YW6HJEFUKGMTMTXE3MRLRUAT24 X-Message-ID-Hash: XXWMY5YW6HJEFUKGMTMTXE3MRLRUAT24 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/33] ext4l: Have hash.c include ext4.h directly 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 Change hash.c to include ext4.h instead of using the EXT4_UBOOT_NO_EXT4_H workaround. This allows removal of the duplicated dx_hash_info struct, DX_HASH_* constants, EXT4_HTREE_EOF_* constants, and ext4_warning macros from ext4_uboot.h since they are already defined in ext4.h. This reduces ext4_uboot.h from 526 to 493 lines. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 34 ---------------------------------- fs/ext4l/hash.c | 4 +--- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 7356ddb6213..14b3d075dd4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -172,40 +172,6 @@ struct path; /* QSTR_INIT and dotdot_name are now in linux/dcache.h */ -/* - * Hash info structure and constants - defined in ext4.h. - * Only defined here for files that don't include ext4.h (like hash.c). - * This is wrapped in EXT4_UBOOT_NO_EXT4_H which hash.c defines. - */ -#ifdef EXT4_UBOOT_NO_EXT4_H -struct dx_hash_info { - u32 hash; - u32 minor_hash; - int hash_version; - u32 *seed; -}; - -/* Hash algorithm types */ -#define DX_HASH_LEGACY 0 -#define DX_HASH_HALF_MD4 1 -#define DX_HASH_TEA 2 -#define DX_HASH_LEGACY_UNSIGNED 3 -#define DX_HASH_HALF_MD4_UNSIGNED 4 -#define DX_HASH_TEA_UNSIGNED 5 -#define DX_HASH_SIPHASH 6 -#define DX_HASH_LAST DX_HASH_SIPHASH - -/* EOF markers for htree */ -#define EXT4_HTREE_EOF_32BIT ((1UL << (32 - 1)) - 1) -#define EXT4_HTREE_EOF_64BIT ((1ULL << (64 - 1)) - 1) - -#define ext4_warning(sb, fmt, ...) \ - do { } while (0) - -#define ext4_warning_inode(inode, fmt, ...) \ - do { } while (0) -#endif - #define vfs_setpos(file, offset, maxsize) ({ (void)(file); (void)(maxsize); (offset); }) #include diff --git a/fs/ext4l/hash.c b/fs/ext4l/hash.c index 58063a872d3..c033e44b2d5 100644 --- a/fs/ext4l/hash.c +++ b/fs/ext4l/hash.c @@ -5,9 +5,7 @@ * Copyright (C) 2002 by Theodore Ts'o */ -#define EXT4_UBOOT_NO_EXT4_H -#include "ext4_uboot.h" -#include +#include "ext4.h" #define DELTA 0x9E3779B9