[Concept,12/26] ext4l: Remove duplicate atomic_add declarations

Message ID 20251231223008.3251711-13-sjg@u-boot.org
State New
Headers
Series ext4l: Add write support (part L) |

Commit Message

Simon Glass Dec. 31, 2025, 10:29 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The atomic_add() and atomic64_add() functions are now provided by
asm-generic/atomic.h so remove the duplicate declarations from
ext4_uboot.h and the implementation from stub.c

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 4 ----
 fs/ext4l/stub.c       | 8 +-------
 2 files changed, 1 insertion(+), 11 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index abe54e67aa4..df26c02b54d 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -2310,10 +2310,6 @@  void *kvzalloc(size_t size, gfp_t flags);
 #define kvmalloc(size, flags)	kvzalloc(size, flags)
 unsigned long roundup_pow_of_two(unsigned long n);
 
-/* Atomic operations - declarations for stub.c */
-void atomic_add(int val, atomic_t *v);
-void atomic64_add(s64 val, atomic64_t *v);
-
 /* Power of 2 check - declaration for stub.c */
 int is_power_of_2(unsigned long n);
 
diff --git a/fs/ext4l/stub.c b/fs/ext4l/stub.c
index f072cb5713f..d328c6821a9 100644
--- a/fs/ext4l/stub.c
+++ b/fs/ext4l/stub.c
@@ -617,13 +617,7 @@  int percpu_init_rwsem(struct percpu_rw_semaphore *sem)
 	return 0;
 }
 
-/* Atomic operations */
-void atomic_add(int val, atomic_t *v)
-{
-	v->counter += val;
-}
-
-/* atomic64_add is now a macro in ext4_uboot.h */
+/* atomic_add and atomic64_add are now in asm-generic/atomic.h */
 
 /* Discard */
 unsigned int bdev_max_discard_sectors(struct block_device *bdev)