From patchwork Thu Jan 8 18:51:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1343 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=1767898338; bh=KCVrTNbdJ6c5Jko7D6CqQR57MUD46KNhM2lUOkAa6Hw=; 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=pj8Kt5VvCgNrBoyLrYATaCGx/opIRtm2J3hEQwf7U76zur+rtjHW0mF+BMWxilXG0 pHT3/Y/0xwUunVMNnt8wVWHeQFbObUICWd+Hbr3EhaUydIzFT1CE5hexKFKMI58hj4 Sr81aXCPKCdDQIx7cYV0Re5zwpls/qf550kSfyuPy9jAC76qyrsqVIK+eAf1DQ3CRp 8+RkDKJKjdKeqRIvqaJAUnLFWbZ8XHZB1hZ5Z9RixkfjGp1JRiV4b6N9Sav33EMnfl er3YbwT0320xWf7kx260WXrTPYuLv9qPZyhWDzbVfvLLWZduWZuZyGvMyWeIJSM6NX wV9rng0T0jHpg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 842AF691BF for ; Thu, 8 Jan 2026 11:52: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 10024) with ESMTP id 6saLXoXDZkvr for ; Thu, 8 Jan 2026 11:52:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898338; bh=KCVrTNbdJ6c5Jko7D6CqQR57MUD46KNhM2lUOkAa6Hw=; 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=pj8Kt5VvCgNrBoyLrYATaCGx/opIRtm2J3hEQwf7U76zur+rtjHW0mF+BMWxilXG0 pHT3/Y/0xwUunVMNnt8wVWHeQFbObUICWd+Hbr3EhaUydIzFT1CE5hexKFKMI58hj4 Sr81aXCPKCdDQIx7cYV0Re5zwpls/qf550kSfyuPy9jAC76qyrsqVIK+eAf1DQ3CRp 8+RkDKJKjdKeqRIvqaJAUnLFWbZ8XHZB1hZ5Z9RixkfjGp1JRiV4b6N9Sav33EMnfl er3YbwT0320xWf7kx260WXrTPYuLv9qPZyhWDzbVfvLLWZduWZuZyGvMyWeIJSM6NX wV9rng0T0jHpg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 73808691C4 for ; Thu, 8 Jan 2026 11:52:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898337; bh=G1e5gImKDW+tp5aepQoCNI5zwnedCXgbcE9Q6zMaL4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/fV8ohwjqeheEDT9Pr15losUOpYGlEfrsJ9Ghg7oDX2ZDdLtm6EBpmDxD99lDtN3 geZ56OTWSn4zyiJmYxD6h2OKJ6pYjXu00s7WXl+FK5yLCRVzuj+9oTcN+++XfvGuKL fRiy8wOC+2lQYxVzC7GGcnmFz9nss65eg/IZ8OOmd3CDtMFvfYqSw3K8uYFBQMNr9I VrRkEEjk78GPsTwUogBpGXU4gsNjPmA4RmnpnOxG4aPLIeqzjwRpsijTXOGZx/V/py aoSVjStkgH+KW4cqlX72oZRgZ0UznFANHcnjBHN4r8Jfrzm02WZs8G0IMUS59HN5en ZEUv12/IbMPcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4C3B569128; Thu, 8 Jan 2026 11:52:17 -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 a59TyuAFfcra; Thu, 8 Jan 2026 11:52:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767898333; bh=HWxM74WF2gCKhoS5phkb8Bc86SQX66jG7eZqDNuy734=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGl6ceQ3rAzUX8kE765p3mb2VAr0QYwID2i4jWoE7i5WWPe2WrseWutoKr0JoY3ZD Y8v+Np4TYQUwoeITXUCxlwVVE3nS0PEjU9AzGJdp1idoaF/zOyUc3yjXQmlV8mFztT RBKlk8dwYdRQV5/OK8cZrlND/my2VRR5fJT9MeQptNm5Ze5Pbf74zRDg5zyIgKbQJL VlbhiKPpme2VkmDu0Ohb7JIhK5yv9lCu6u2sFS/s9et1JVmXk+1DtoylDfQkEkTmZl /l6eLstR6dmWJWvxGysdtk/QucvzOlFMIlwYq9VfzZOyVAq7nUZ8de5W6lLMjBagR+ IcQSy1KNW/iTA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F21E169101; Thu, 8 Jan 2026 11:52:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 11:51:17 -0700 Message-ID: <20260108185149.1995917-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108185149.1995917-1-sjg@u-boot.org> References: <20260108185149.1995917-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DIECLVBUZ2QWXZKDGJQSG4G2B2HO4B2D X-Message-ID-Hash: DIECLVBUZ2QWXZKDGJQSG4G2B2HO4B2D 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/21] ext4l: Make use of log.2 instead of defining locally 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 Make use of the existing linux/log.h header which is supported on most boards. Drop the unnecessary code in the header and stub files. Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 14 ++------------ fs/ext4l/stub.c | 15 --------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 04b76af7f09..c975396dec4 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -19,6 +19,7 @@ #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-variable" +#include #include #include #include /* For panic() */ @@ -28,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +38,6 @@ #include #include /* Real rbtree implementation */ #include /* For crc32() used by crc32_be */ -#include /* * Enable ext4_msg() and other diagnostic macros to pass full messages. @@ -1458,10 +1459,6 @@ typedef unsigned int projid_t; __ret == __old; \ }) -/* ilog2 - log base 2 */ -#include -#define ilog2(n) (fls(n) - 1) - /* hash_64 - simple 64-bit hash */ #define hash_64(val, bits) ((unsigned long)((val) >> (64 - (bits)))) @@ -2370,10 +2367,6 @@ void fscrypt_show_test_dummy_encryption(struct seq_file *seq, char sep, /* Memory allocation - declarations for stub.c */ void *kvzalloc(size_t size, gfp_t flags); #define kvmalloc(size, flags) kvzalloc(size, flags) -unsigned long roundup_pow_of_two(unsigned long n); - -/* Power of 2 check - declaration for stub.c */ -int is_power_of_2(unsigned long n); /* Time operations */ #define ktime_get_ns() (0ULL) @@ -2651,9 +2644,6 @@ struct seq_operations { /* Block layer constants */ #define BLK_MAX_SEGMENT_SIZE 65536 -/* order_base_2 - log2 rounded up */ -#define order_base_2(n) ilog2(roundup_pow_of_two(n)) - /* num_possible_cpus - number of possible CPUs (always 1 in U-Boot) */ #define num_possible_cpus() 1 diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c index d328c6821a9..af0bb045d5f 100644 --- a/fs/ext4l/stub.c +++ b/fs/ext4l/stub.c @@ -360,15 +360,6 @@ void ext4_force_shutdown(void *sb, int flags) } /* Memory stubs */ -unsigned long roundup_pow_of_two(unsigned long n) -{ - unsigned long ret = 1; - - while (ret < n) - ret <<= 1; - return ret; -} - void *kvzalloc(size_t size, gfp_t flags) { return calloc(1, size); @@ -525,12 +516,6 @@ int sb_set_blocksize(struct super_block *sb, int size) return size; } -/* Power of 2 check */ -int is_power_of_2(unsigned long n) -{ - return n != 0 && (n & (n - 1)) == 0; -} - /* strscpy_pad is now a macro in ext4_uboot.h */ /* kmemdup_nul is defined earlier in this file */