linux: Drop duplicate atomic types from types.h

The atomic types were incorrectly added to linux/types.h but they
already exist in asm-generic/atomic.h. Remove them and update ext4l
to include the correct header.

Fixes: e911e32822 ("linux: Move common types to types.h")
Series-to: concept

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-12-21 12:31:22 -07:00
parent 4a94ac6845
commit 07d2a31287
2 changed files with 4 additions and 24 deletions

View File

@@ -58,14 +58,16 @@ struct timespec64 {
};
/*
* ktime_t, atomic_t, atomic64_t, sector_t are now in linux/types.h
* ktime_t, sector_t are now in linux/types.h
* atomic_t, atomic64_t are now in asm-generic/atomic.h
* MAX_JIFFY_OFFSET is now in linux/jiffies.h
* BDEVNAME_SIZE is now in linux/blkdev.h
*/
#include <asm-generic/atomic.h>
#include <linux/jiffies.h>
#include <linux/blkdev.h>
/* Extra atomic operation not in linux/types.h */
/* Extra atomic operation not in asm-generic/atomic.h */
#define atomic_dec_if_positive(v) (--(v)->counter)
/* SMP stubs - U-Boot is single-threaded */

View File

@@ -165,28 +165,6 @@ typedef s64 ktime_t;
typedef u64 sector_t;
typedef u64 blkcnt_t;
/* Atomic types - stubs for single-threaded U-Boot */
typedef struct {
int counter;
} atomic_t;
#ifdef CONFIG_64BIT
typedef struct {
s64 counter;
} atomic64_t;
#else
typedef struct {
long counter;
} atomic64_t;
#endif
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) ((v)->counter = (i))
#define atomic_inc(v) ((v)->counter++)
#define atomic_dec(v) ((v)->counter--)
#define atomic64_read(v) ((v)->counter)
#define atomic64_set(v, i) ((v)->counter = (i))
#ifdef __linux__
struct ustat {
__kernel_daddr_t f_tfree;