Skip to content

Commit b5fbae9

Browse files
author
Fox Snowpatch
committed
1 parent 5c2c0ba commit b5fbae9

12 files changed

Lines changed: 18 additions & 18 deletions

File tree

arch/alpha/include/asm/cmpxchg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ ____cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
234234

235235
#define arch_cmpxchg_local(ptr, o, n) \
236236
({ \
237-
__typeof__(*(ptr)) _o_ = (o); \
237+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
238238
__typeof__(*(ptr)) _n_ = (n); \
239239
(__typeof__(*(ptr))) ____cmpxchg((ptr), (unsigned long)_o_, \
240240
(unsigned long)_n_, \
@@ -265,7 +265,7 @@ ____cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
265265
#define arch_cmpxchg(ptr, o, n) \
266266
({ \
267267
__typeof__(*(ptr)) __ret; \
268-
__typeof__(*(ptr)) _o_ = (o); \
268+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
269269
__typeof__(*(ptr)) _n_ = (n); \
270270
smp_mb(); \
271271
__ret = (__typeof__(*(ptr))) ____cmpxchg((ptr), \

arch/arc/include/asm/cmpxchg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define arch_cmpxchg_relaxed(ptr, old, new) \
4343
({ \
4444
__typeof__(ptr) _p_ = (ptr); \
45-
__typeof__(*(ptr)) _o_ = (old); \
45+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(old); \
4646
__typeof__(*(ptr)) _n_ = (new); \
4747
__typeof__(*(ptr)) _prev_; \
4848
\
@@ -64,7 +64,7 @@
6464
#define arch_cmpxchg(ptr, old, new) \
6565
({ \
6666
volatile __typeof__(ptr) _p_ = (ptr); \
67-
__typeof__(*(ptr)) _o_ = (old); \
67+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(old); \
6868
__typeof__(*(ptr)) _n_ = (new); \
6969
__typeof__(*(ptr)) _prev_; \
7070
unsigned long __flags; \

arch/hexagon/include/asm/cmpxchg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size)
5454
#define arch_cmpxchg(ptr, old, new) \
5555
({ \
5656
__typeof__(ptr) __ptr = (ptr); \
57-
__typeof__(*(ptr)) __old = (old); \
57+
__typeof__(*(ptr)) __old = (__typeof__(*(ptr)))(old); \
5858
__typeof__(*(ptr)) __new = (new); \
5959
__typeof__(*(ptr)) __oldval = (__typeof__(*(ptr))) 0; \
6060
\

arch/parisc/include/asm/cmpxchg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
7878

7979
#define arch_cmpxchg(ptr, o, n) \
8080
({ \
81-
__typeof__(*(ptr)) _o_ = (o); \
81+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
8282
__typeof__(*(ptr)) _n_ = (n); \
8383
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
8484
(unsigned long)_n_, sizeof(*(ptr))); \

arch/powerpc/include/asm/cmpxchg.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,
698698
}
699699
#define arch_cmpxchg(ptr, o, n) \
700700
({ \
701-
__typeof__(*(ptr)) _o_ = (o); \
701+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
702702
__typeof__(*(ptr)) _n_ = (n); \
703703
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
704704
(unsigned long)_n_, sizeof(*(ptr))); \
@@ -707,15 +707,15 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,
707707

708708
#define arch_cmpxchg_local(ptr, o, n) \
709709
({ \
710-
__typeof__(*(ptr)) _o_ = (o); \
710+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
711711
__typeof__(*(ptr)) _n_ = (n); \
712712
(__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
713713
(unsigned long)_n_, sizeof(*(ptr))); \
714714
})
715715

716716
#define arch_cmpxchg_relaxed(ptr, o, n) \
717717
({ \
718-
__typeof__(*(ptr)) _o_ = (o); \
718+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
719719
__typeof__(*(ptr)) _n_ = (n); \
720720
(__typeof__(*(ptr))) __cmpxchg_relaxed((ptr), \
721721
(unsigned long)_o_, (unsigned long)_n_, \
@@ -724,7 +724,7 @@ __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,
724724

725725
#define arch_cmpxchg_acquire(ptr, o, n) \
726726
({ \
727-
__typeof__(*(ptr)) _o_ = (o); \
727+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
728728
__typeof__(*(ptr)) _n_ = (n); \
729729
(__typeof__(*(ptr))) __cmpxchg_acquire((ptr), \
730730
(unsigned long)_o_, (unsigned long)_n_, \

arch/riscv/include/asm/cmpxchg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
cas_prepend, cas_append) \
216216
({ \
217217
__typeof__(ptr) __ptr = (ptr); \
218-
__typeof__(*(__ptr)) __old = (old); \
218+
__typeof__(*(__ptr)) __old = (__typeof__(*(__ptr)))(old); \
219219
__typeof__(*(__ptr)) __new = (new); \
220220
__typeof__(*(__ptr)) __ret; \
221221
\
@@ -331,7 +331,7 @@ union __u128_halves {
331331

332332
#define __arch_cmpxchg128(p, o, n, cas_sfx) \
333333
({ \
334-
__typeof__(*(p)) __o = (o); \
334+
__typeof__(*(p)) __o = (__typeof__(*(p)))(o); \
335335
union __u128_halves __hn = { .full = (n) }; \
336336
union __u128_halves __ho = { .full = (__o) }; \
337337
register unsigned long t1 asm ("t1") = __hn.low; \

arch/sh/include/asm/cmpxchg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
6868

6969
#define arch_cmpxchg(ptr,o,n) \
7070
({ \
71-
__typeof__(*(ptr)) _o_ = (o); \
71+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
7272
__typeof__(*(ptr)) _n_ = (n); \
7373
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
7474
(unsigned long)_n_, sizeof(*(ptr))); \

arch/sparc/include/asm/cmpxchg_32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
5555

5656
#define arch_cmpxchg(ptr, o, n) \
5757
({ \
58-
__typeof__(*(ptr)) _o_ = (o); \
58+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
5959
__typeof__(*(ptr)) _n_ = (n); \
6060
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
6161
(unsigned long)_n_, sizeof(*(ptr))); \

arch/sparc/include/asm/cmpxchg_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
170170

171171
#define arch_cmpxchg(ptr,o,n) \
172172
({ \
173-
__typeof__(*(ptr)) _o_ = (o); \
173+
__typeof__(*(ptr)) _o_ = (__typeof__(*(ptr)))(o); \
174174
__typeof__(*(ptr)) _n_ = (n); \
175175
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
176176
(unsigned long)_n_, sizeof(*(ptr))); \

arch/x86/include/asm/cmpxchg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern void __add_wrong_size(void)
8585
#define __raw_cmpxchg(ptr, old, new, size, lock) \
8686
({ \
8787
__typeof__(*(ptr)) __ret; \
88-
__typeof__(*(ptr)) __old = (old); \
88+
__typeof__(*(ptr)) __old = (__typeof__(*(ptr)))(old); \
8989
__typeof__(*(ptr)) __new = (new); \
9090
switch (size) { \
9191
case __X86_CASE_B: \

0 commit comments

Comments
 (0)