hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/asm-generic/percpu.h
....@@ -5,7 +5,6 @@
55 #include <linux/compiler.h>
66 #include <linux/threads.h>
77 #include <linux/percpu-defs.h>
8
-#include <linux/irqflags.h>
98
109 #ifdef CONFIG_SMP
1110
....@@ -63,10 +62,6 @@
6362 #define PER_CPU_ATTRIBUTES
6463 #endif
6564
66
-#ifndef PER_CPU_DEF_ATTRIBUTES
67
-#define PER_CPU_DEF_ATTRIBUTES
68
-#endif
69
-
7065 #define raw_cpu_generic_read(pcp) \
7166 ({ \
7267 *raw_cpu_ptr(&(pcp)); \
....@@ -79,7 +74,7 @@
7974
8075 #define raw_cpu_generic_add_return(pcp, val) \
8176 ({ \
82
- typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
77
+ typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
8378 \
8479 *__p += val; \
8580 *__p; \
....@@ -87,7 +82,7 @@
8782
8883 #define raw_cpu_generic_xchg(pcp, nval) \
8984 ({ \
90
- typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
85
+ typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
9186 typeof(pcp) __ret; \
9287 __ret = *__p; \
9388 *__p = nval; \
....@@ -96,7 +91,7 @@
9691
9792 #define raw_cpu_generic_cmpxchg(pcp, oval, nval) \
9893 ({ \
99
- typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
94
+ typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
10095 typeof(pcp) __ret; \
10196 __ret = *__p; \
10297 if (__ret == (oval)) \
....@@ -106,8 +101,8 @@
106101
107102 #define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
108103 ({ \
109
- typeof(&(pcp1)) __p1 = raw_cpu_ptr(&(pcp1)); \
110
- typeof(&(pcp2)) __p2 = raw_cpu_ptr(&(pcp2)); \
104
+ typeof(pcp1) *__p1 = raw_cpu_ptr(&(pcp1)); \
105
+ typeof(pcp2) *__p2 = raw_cpu_ptr(&(pcp2)); \
111106 int __ret = 0; \
112107 if (*__p1 == (oval1) && *__p2 == (oval2)) { \
113108 *__p1 = nval1; \
....@@ -119,21 +114,21 @@
119114
120115 #define __this_cpu_generic_read_nopreempt(pcp) \
121116 ({ \
122
- typeof(pcp) __ret; \
117
+ typeof(pcp) ___ret; \
123118 preempt_disable_notrace(); \
124
- __ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
119
+ ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
125120 preempt_enable_notrace(); \
126
- __ret; \
121
+ ___ret; \
127122 })
128123
129124 #define __this_cpu_generic_read_noirq(pcp) \
130125 ({ \
131
- typeof(pcp) __ret; \
132
- unsigned long __flags; \
133
- raw_local_irq_save(__flags); \
134
- __ret = raw_cpu_generic_read(pcp); \
135
- raw_local_irq_restore(__flags); \
136
- __ret; \
126
+ typeof(pcp) ___ret; \
127
+ unsigned long ___flags; \
128
+ raw_local_irq_save(___flags); \
129
+ ___ret = raw_cpu_generic_read(pcp); \
130
+ raw_local_irq_restore(___flags); \
131
+ ___ret; \
137132 })
138133
139134 #define this_cpu_generic_read(pcp) \