[Concept,08/34] ext4l: Remove duplicate percpu_counter stubs

Message ID 20260114225635.3407989-9-sjg@u-boot.org
State New
Headers
Series ext4l: Clean up ext4_uboot.h by moving definitions to standard headers |

Commit Message

Simon Glass Jan. 14, 2026, 10:55 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

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 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
  

Patch

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)