From patchwork Wed Jan 14 22:55:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1502 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=1768431451; bh=TayjaULz0uxRTyXaDrD33wJ78XdJ1fP155TeEfa6OKA=; 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=oNELeC/IcKwvZkiMS8IranCmAVuUOBRUXqzxRxXEWjtiuvujBtEredn1qq9q+XkTA jgEs4qlsv5VX8hXOF/3RyxwNv5DvQvnWcJQm9MVzCFal2NTpKP0xSRb0LDwr6Fyf+9 xspjgoSJXyus+pLcZCyVBF670UiwuAvOHyfiNNyf6V51TnhS8hW2hdib4mwgHuaYB6 Uwu8Hef8gTc7MldSSM2y2FuSBoSusrt6vOVHvxGswwp7LF6h4qnvOjThunWtUyMgKF qt3xlVHOxtHk/Mz5fJ8f6evaEmmztUjfug0DJS/0A+WAgkdTDN+qBtGeiPD/0NvzV+ hG7Juk/uwQSdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 146BF692F1 for ; Wed, 14 Jan 2026 15:57:31 -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 UwwylUU_e0GY for ; Wed, 14 Jan 2026 15:57:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431450; bh=TayjaULz0uxRTyXaDrD33wJ78XdJ1fP155TeEfa6OKA=; 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=TBGDbatmD+baeP1BpOP6ybINHnndDfcX2rrKNwV77lJhL+u2tElMkAyPGfDncbnH8 LRxzny+DyP4l+bTx0Y9bX4jQ5ZJw0+aMTvMjyprjpxtDHHNtw8qS9j+k3uCYGtyuvF BLeR1fPDhWupU73eZnsZvhM8AS7LB19jRsGWeMm3+L8OH7oxslyxfyOQ+CGq1ke1PH xZvU16pv7mgr/5DF20MnzmoXO11D0q/CqMTj+CHCoRuGo06Ai1N+psu4HPB2NV2Y97 1ksGodhld6V/6ZHt0E7FSVEd1pHWH9oV1ZlKNEp6BeTmMHvpsUsQfF8ZDtQmbMy9Gg TqL8THmMNkU9g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F2DF969342 for ; Wed, 14 Jan 2026 15:57:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431449; bh=/2uQEhj/B9xsBG45GwUa07pVGAHcZIDpsTFwn0LkQQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEZ6CBirYrLNHCGAZFRaqZAWdTvsx4g/sX2aQ2Gtw7zPcr0WIBzVKvcrxhu0gbiVS rdPjDLr30tesCNCm8nCzAWd6ChyimPnheFoxwfQkFLy75YifPqXlrtgul1ViMoI7f1 7e/w09MvXJGZOSEmGo1XjawoOmtFZOmfZQF7jzVbDcGJQs2icCBWaxJN+4O1uxqywb 8A0MRI1T4IAZurdyfe4lIg5OPFXssYHyFk6lXAGVvOnipT90GtZbYOw5dwWhLpJmA1 7ApH2iscyHdTz/wk+TEMY2aYsnzD8RKDFmalIniLxCiGdXFXZHzjTxRcXw+3D2I52F jouXYuhi4ZGBQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1788F692F1; Wed, 14 Jan 2026 15:57:29 -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 t_BZluI-1kri; Wed, 14 Jan 2026 15:57:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431445; bh=vVHZvdyHoM11DMYvE46aLbtI6QyJtf2yGu+HhnPdbG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vOuFplK9WLcuOLDMWNx7/DBVHv8iiEWVK9fYInP0IWIho7bmdH02eG5GgqdYkG2+L yvbm9ViqY3pfoCZUKnPon4KAc3YoC2xoItrkwQjzZCtIeXqhX/9yQdK1FWClp79HQZ Zk3JKprGrYQZJ/U31i9/BWLrA8ge2lNkn2vQESQL2+rnt3GxFwTEd+rl0rYkC02fq5 5K30niZ9ZhN7Q1teqcVxtE2cDF/Y+K7NAcKoLA0csShBrFMf1FJMphHkqQxeFaFb2Q ua2tdVGOn81DJEqf8R/W4MKOHjwmF9zpyYcVAZxEJoOWoacfsVRFTtl3/7niTkoArw 5VLObArnacnUg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BC11C692EF; Wed, 14 Jan 2026 15:57:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:55:58 -0700 Message-ID: <20260114225635.3407989-9-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: CH2TMLFRLGHYPDNG33GD755EKGRAP76I X-Message-ID-Hash: CH2TMLFRLGHYPDNG33GD755EKGRAP76I 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 08/34] ext4l: Remove duplicate percpu_counter 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 percpu_counter stubs from ext4_uboot.h that are already defined as inline functions in include/linux/percpu_counter.h The header file provides proper implementations for single-threaded U-Boot operation. Removed duplicates: - percpu_counter_read_positive - percpu_counter_sum_positive - percpu_counter_add - percpu_counter_inc - percpu_counter_dec - percpu_counter_initialized - percpu_counter_init - percpu_counter_destroy - percpu_counter_sub Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index c6795b35501..aee6938977d 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -336,13 +336,7 @@ struct buffer_head *sb_getblk(struct super_block *sb, sector_t block); /* KUNIT stub */ #define KUNIT_STATIC_STUB_REDIRECT(...) do { } while (0) -/* percpu_counter operations - stubs */ -#define percpu_counter_read_positive(fbc) ((fbc)->count) -#define percpu_counter_sum_positive(fbc) ((fbc)->count) -#define percpu_counter_add(fbc, amount) ((fbc)->count += (amount)) -#define percpu_counter_inc(fbc) ((fbc)->count++) -#define percpu_counter_dec(fbc) ((fbc)->count--) -#define percpu_counter_initialized(fbc) ((fbc)->initialized) +/* percpu_counter operations are in linux/percpu_counter.h */ /* Group permission - stub */ #define in_group_p(gid) (0) @@ -1188,10 +1182,7 @@ static inline ktime_t ktime_add_ns(ktime_t kt, s64 ns) /* write lock variants */ #define write_trylock(lock) ({ (void)(lock); 1; }) -/* percpu counter init/destroy */ -#define percpu_counter_init(fbc, val, gfp) \ - ({ (fbc)->count = (val); (fbc)->initialized = true; 0; }) -#define percpu_counter_destroy(fbc) do { } while (0) +/* percpu_counter_init/destroy are in linux/percpu_counter.h */ /* ratelimit macros */ #define DEFAULT_RATELIMIT_INTERVAL (5 * 1000) @@ -1480,8 +1471,7 @@ static inline char *d_path(const struct path *path, char *buf, int buflen) #define dquot_transfer(m, i, a) ({ (void)(m); (void)(i); (void)(a); 0; }) #define is_quota_modification(m, i, a) ({ (void)(m); (void)(i); (void)(a); 0; }) -/* Percpu counter sub */ -#define percpu_counter_sub(fbc, amount) ((fbc)->count -= (amount)) +/* percpu_counter_sub is in linux/percpu_counter.h */ /* Filemap operations - additional */ #define filemap_get_folio(m, i) ((struct folio *)NULL)