diff options
Diffstat (limited to 'arch/sh/include/asm/atomic-irq.h')
-rw-r--r-- | arch/sh/include/asm/atomic-irq.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/sh/include/asm/atomic-irq.h b/arch/sh/include/asm/atomic-irq.h index 74f7943cff6f..a0b348068cae 100644 --- a/arch/sh/include/asm/atomic-irq.h +++ b/arch/sh/include/asm/atomic-irq.h | |||
@@ -11,7 +11,7 @@ static inline void atomic_add(int i, atomic_t *v) | |||
11 | unsigned long flags; | 11 | unsigned long flags; |
12 | 12 | ||
13 | local_irq_save(flags); | 13 | local_irq_save(flags); |
14 | *(long *)v += i; | 14 | v->counter += i; |
15 | local_irq_restore(flags); | 15 | local_irq_restore(flags); |
16 | } | 16 | } |
17 | 17 | ||
@@ -20,7 +20,7 @@ static inline void atomic_sub(int i, atomic_t *v) | |||
20 | unsigned long flags; | 20 | unsigned long flags; |
21 | 21 | ||
22 | local_irq_save(flags); | 22 | local_irq_save(flags); |
23 | *(long *)v -= i; | 23 | v->counter -= i; |
24 | local_irq_restore(flags); | 24 | local_irq_restore(flags); |
25 | } | 25 | } |
26 | 26 | ||
@@ -29,9 +29,9 @@ static inline int atomic_add_return(int i, atomic_t *v) | |||
29 | unsigned long temp, flags; | 29 | unsigned long temp, flags; |
30 | 30 | ||
31 | local_irq_save(flags); | 31 | local_irq_save(flags); |
32 | temp = *(long *)v; | 32 | temp = v->counter; |
33 | temp += i; | 33 | temp += i; |
34 | *(long *)v = temp; | 34 | v->counter = temp; |
35 | local_irq_restore(flags); | 35 | local_irq_restore(flags); |
36 | 36 | ||
37 | return temp; | 37 | return temp; |
@@ -42,9 +42,9 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
42 | unsigned long temp, flags; | 42 | unsigned long temp, flags; |
43 | 43 | ||
44 | local_irq_save(flags); | 44 | local_irq_save(flags); |
45 | temp = *(long *)v; | 45 | temp = v->counter; |
46 | temp -= i; | 46 | temp -= i; |
47 | *(long *)v = temp; | 47 | v->counter = temp; |
48 | local_irq_restore(flags); | 48 | local_irq_restore(flags); |
49 | 49 | ||
50 | return temp; | 50 | return temp; |
@@ -55,7 +55,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | |||
55 | unsigned long flags; | 55 | unsigned long flags; |
56 | 56 | ||
57 | local_irq_save(flags); | 57 | local_irq_save(flags); |
58 | *(long *)v &= ~mask; | 58 | v->counter &= ~mask; |
59 | local_irq_restore(flags); | 59 | local_irq_restore(flags); |
60 | } | 60 | } |
61 | 61 | ||
@@ -64,7 +64,7 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | |||
64 | unsigned long flags; | 64 | unsigned long flags; |
65 | 65 | ||
66 | local_irq_save(flags); | 66 | local_irq_save(flags); |
67 | *(long *)v |= mask; | 67 | v->counter |= mask; |
68 | local_irq_restore(flags); | 68 | local_irq_restore(flags); |
69 | } | 69 | } |
70 | 70 | ||