Skip to content

Commit 4331f4d

Browse files
rddunlapKAGA-KOKO
authored andcommitted
x86: Fix kernel-doc atomic.h warnings
Fix kernel-doc warnings in arch/x86/include/asm/atomic.h that are caused by having a #define macro between the kernel-doc notation and the function name. Fixed by moving the #define macro to after the function implementation. Make the same change for atomic64_{32,64}.h for consistency even though there were no kernel-doc warnings found in these header files, but there would be if they were used in generation of documentation. Fixes these kernel-doc warnings: ../arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'i' description in 'arch_atomic_sub_and_test' ../arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'v' description in 'arch_atomic_sub_and_test' ../arch/x86/include/asm/atomic.h:96: warning: Excess function parameter 'v' description in 'arch_atomic_inc' ../arch/x86/include/asm/atomic.h:109: warning: Excess function parameter 'v' description in 'arch_atomic_dec' ../arch/x86/include/asm/atomic.h:124: warning: Excess function parameter 'v' description in 'arch_atomic_dec_and_test' ../arch/x86/include/asm/atomic.h:138: warning: Excess function parameter 'v' description in 'arch_atomic_inc_and_test' ../arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'i' description in 'arch_atomic_add_negative' ../arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'v' description in 'arch_atomic_add_negative' Fixes: 18cc181 ("atomics/treewide: Make test ops optional") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Link: https://lkml.kernel.org/r/0a1e678d-c8c5-b32c-2640-ed4e94d399d2@infradead.org
1 parent 8da38eb commit 4331f4d

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

arch/x86/include/asm/atomic.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,37 +80,37 @@ static __always_inline void arch_atomic_sub(int i, atomic_t *v)
8080
* true if the result is zero, or false for all
8181
* other cases.
8282
*/
83-
#define arch_atomic_sub_and_test arch_atomic_sub_and_test
8483
static __always_inline bool arch_atomic_sub_and_test(int i, atomic_t *v)
8584
{
8685
GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", e);
8786
}
87+
#define arch_atomic_sub_and_test arch_atomic_sub_and_test
8888

8989
/**
9090
* arch_atomic_inc - increment atomic variable
9191
* @v: pointer of type atomic_t
9292
*
9393
* Atomically increments @v by 1.
9494
*/
95-
#define arch_atomic_inc arch_atomic_inc
9695
static __always_inline void arch_atomic_inc(atomic_t *v)
9796
{
9897
asm volatile(LOCK_PREFIX "incl %0"
9998
: "+m" (v->counter));
10099
}
100+
#define arch_atomic_inc arch_atomic_inc
101101

102102
/**
103103
* arch_atomic_dec - decrement atomic variable
104104
* @v: pointer of type atomic_t
105105
*
106106
* Atomically decrements @v by 1.
107107
*/
108-
#define arch_atomic_dec arch_atomic_dec
109108
static __always_inline void arch_atomic_dec(atomic_t *v)
110109
{
111110
asm volatile(LOCK_PREFIX "decl %0"
112111
: "+m" (v->counter));
113112
}
113+
#define arch_atomic_dec arch_atomic_dec
114114

115115
/**
116116
* arch_atomic_dec_and_test - decrement and test
@@ -120,11 +120,11 @@ static __always_inline void arch_atomic_dec(atomic_t *v)
120120
* returns true if the result is 0, or false for all other
121121
* cases.
122122
*/
123-
#define arch_atomic_dec_and_test arch_atomic_dec_and_test
124123
static __always_inline bool arch_atomic_dec_and_test(atomic_t *v)
125124
{
126125
GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, "%0", e);
127126
}
127+
#define arch_atomic_dec_and_test arch_atomic_dec_and_test
128128

129129
/**
130130
* arch_atomic_inc_and_test - increment and test
@@ -134,11 +134,11 @@ static __always_inline bool arch_atomic_dec_and_test(atomic_t *v)
134134
* and returns true if the result is zero, or false for all
135135
* other cases.
136136
*/
137-
#define arch_atomic_inc_and_test arch_atomic_inc_and_test
138137
static __always_inline bool arch_atomic_inc_and_test(atomic_t *v)
139138
{
140139
GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, "%0", e);
141140
}
141+
#define arch_atomic_inc_and_test arch_atomic_inc_and_test
142142

143143
/**
144144
* arch_atomic_add_negative - add and test if negative
@@ -149,11 +149,11 @@ static __always_inline bool arch_atomic_inc_and_test(atomic_t *v)
149149
* if the result is negative, or false when
150150
* result is greater than or equal to zero.
151151
*/
152-
#define arch_atomic_add_negative arch_atomic_add_negative
153152
static __always_inline bool arch_atomic_add_negative(int i, atomic_t *v)
154153
{
155154
GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", s);
156155
}
156+
#define arch_atomic_add_negative arch_atomic_add_negative
157157

158158
/**
159159
* arch_atomic_add_return - add integer and return

arch/x86/include/asm/atomic64_32.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,25 +205,25 @@ static inline long long arch_atomic64_sub(long long i, atomic64_t *v)
205205
*
206206
* Atomically increments @v by 1.
207207
*/
208-
#define arch_atomic64_inc arch_atomic64_inc
209208
static inline void arch_atomic64_inc(atomic64_t *v)
210209
{
211210
__alternative_atomic64(inc, inc_return, /* no output */,
212211
"S" (v) : "memory", "eax", "ecx", "edx");
213212
}
213+
#define arch_atomic64_inc arch_atomic64_inc
214214

215215
/**
216216
* arch_atomic64_dec - decrement atomic64 variable
217217
* @v: pointer to type atomic64_t
218218
*
219219
* Atomically decrements @v by 1.
220220
*/
221-
#define arch_atomic64_dec arch_atomic64_dec
222221
static inline void arch_atomic64_dec(atomic64_t *v)
223222
{
224223
__alternative_atomic64(dec, dec_return, /* no output */,
225224
"S" (v) : "memory", "eax", "ecx", "edx");
226225
}
226+
#define arch_atomic64_dec arch_atomic64_dec
227227

228228
/**
229229
* arch_atomic64_add_unless - add unless the number is a given value
@@ -245,23 +245,23 @@ static inline int arch_atomic64_add_unless(atomic64_t *v, long long a,
245245
return (int)a;
246246
}
247247

248-
#define arch_atomic64_inc_not_zero arch_atomic64_inc_not_zero
249248
static inline int arch_atomic64_inc_not_zero(atomic64_t *v)
250249
{
251250
int r;
252251
alternative_atomic64(inc_not_zero, "=&a" (r),
253252
"S" (v) : "ecx", "edx", "memory");
254253
return r;
255254
}
255+
#define arch_atomic64_inc_not_zero arch_atomic64_inc_not_zero
256256

257-
#define arch_atomic64_dec_if_positive arch_atomic64_dec_if_positive
258257
static inline long long arch_atomic64_dec_if_positive(atomic64_t *v)
259258
{
260259
long long r;
261260
alternative_atomic64(dec_if_positive, "=&A" (r),
262261
"S" (v) : "ecx", "memory");
263262
return r;
264263
}
264+
#define arch_atomic64_dec_if_positive arch_atomic64_dec_if_positive
265265

266266
#undef alternative_atomic64
267267
#undef __alternative_atomic64

arch/x86/include/asm/atomic64_64.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,39 +71,39 @@ static inline void arch_atomic64_sub(long i, atomic64_t *v)
7171
* true if the result is zero, or false for all
7272
* other cases.
7373
*/
74-
#define arch_atomic64_sub_and_test arch_atomic64_sub_and_test
7574
static inline bool arch_atomic64_sub_and_test(long i, atomic64_t *v)
7675
{
7776
GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", e);
7877
}
78+
#define arch_atomic64_sub_and_test arch_atomic64_sub_and_test
7979

8080
/**
8181
* arch_atomic64_inc - increment atomic64 variable
8282
* @v: pointer to type atomic64_t
8383
*
8484
* Atomically increments @v by 1.
8585
*/
86-
#define arch_atomic64_inc arch_atomic64_inc
8786
static __always_inline void arch_atomic64_inc(atomic64_t *v)
8887
{
8988
asm volatile(LOCK_PREFIX "incq %0"
9089
: "=m" (v->counter)
9190
: "m" (v->counter));
9291
}
92+
#define arch_atomic64_inc arch_atomic64_inc
9393

9494
/**
9595
* arch_atomic64_dec - decrement atomic64 variable
9696
* @v: pointer to type atomic64_t
9797
*
9898
* Atomically decrements @v by 1.
9999
*/
100-
#define arch_atomic64_dec arch_atomic64_dec
101100
static __always_inline void arch_atomic64_dec(atomic64_t *v)
102101
{
103102
asm volatile(LOCK_PREFIX "decq %0"
104103
: "=m" (v->counter)
105104
: "m" (v->counter));
106105
}
106+
#define arch_atomic64_dec arch_atomic64_dec
107107

108108
/**
109109
* arch_atomic64_dec_and_test - decrement and test
@@ -113,11 +113,11 @@ static __always_inline void arch_atomic64_dec(atomic64_t *v)
113113
* returns true if the result is 0, or false for all other
114114
* cases.
115115
*/
116-
#define arch_atomic64_dec_and_test arch_atomic64_dec_and_test
117116
static inline bool arch_atomic64_dec_and_test(atomic64_t *v)
118117
{
119118
GEN_UNARY_RMWcc(LOCK_PREFIX "decq", v->counter, "%0", e);
120119
}
120+
#define arch_atomic64_dec_and_test arch_atomic64_dec_and_test
121121

122122
/**
123123
* arch_atomic64_inc_and_test - increment and test
@@ -127,11 +127,11 @@ static inline bool arch_atomic64_dec_and_test(atomic64_t *v)
127127
* and returns true if the result is zero, or false for all
128128
* other cases.
129129
*/
130-
#define arch_atomic64_inc_and_test arch_atomic64_inc_and_test
131130
static inline bool arch_atomic64_inc_and_test(atomic64_t *v)
132131
{
133132
GEN_UNARY_RMWcc(LOCK_PREFIX "incq", v->counter, "%0", e);
134133
}
134+
#define arch_atomic64_inc_and_test arch_atomic64_inc_and_test
135135

136136
/**
137137
* arch_atomic64_add_negative - add and test if negative
@@ -142,11 +142,11 @@ static inline bool arch_atomic64_inc_and_test(atomic64_t *v)
142142
* if the result is negative, or false when
143143
* result is greater than or equal to zero.
144144
*/
145-
#define arch_atomic64_add_negative arch_atomic64_add_negative
146145
static inline bool arch_atomic64_add_negative(long i, atomic64_t *v)
147146
{
148147
GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", s);
149148
}
149+
#define arch_atomic64_add_negative arch_atomic64_add_negative
150150

151151
/**
152152
* arch_atomic64_add_return - add and return

0 commit comments

Comments
 (0)