Skip to content

Commit 89b5810

Browse files
bvanasschepaulusmack
authored andcommitted
powerpc: Make sure that include/asm-powerpc/spinlock.h does not trigger compilation warnings
When compiling kernel modules for ppc that include <linux/spinlock.h>, gcc prints a warning message every time it encounters a function declaration where the inline keyword appears after the return type. This makes sure that the order of the inline keyword and the return type is as gcc expects it. Additionally, the __inline__ keyword is replaced by inline, as checkpatch expects. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent fcbc5a9 commit 89b5810

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

include/asm-powerpc/spinlock.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* This returns the old value in the lock, so we succeeded
5555
* in getting the lock if the return value is 0.
5656
*/
57-
static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock)
57+
static inline unsigned long __spin_trylock(raw_spinlock_t *lock)
5858
{
5959
unsigned long tmp, token;
6060

@@ -73,7 +73,7 @@ static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock)
7373
return tmp;
7474
}
7575

76-
static int __inline__ __raw_spin_trylock(raw_spinlock_t *lock)
76+
static inline int __raw_spin_trylock(raw_spinlock_t *lock)
7777
{
7878
CLEAR_IO_SYNC;
7979
return __spin_trylock(lock) == 0;
@@ -104,7 +104,7 @@ extern void __rw_yield(raw_rwlock_t *lock);
104104
#define SHARED_PROCESSOR 0
105105
#endif
106106

107-
static void __inline__ __raw_spin_lock(raw_spinlock_t *lock)
107+
static inline void __raw_spin_lock(raw_spinlock_t *lock)
108108
{
109109
CLEAR_IO_SYNC;
110110
while (1) {
@@ -119,7 +119,8 @@ static void __inline__ __raw_spin_lock(raw_spinlock_t *lock)
119119
}
120120
}
121121

122-
static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
122+
static inline
123+
void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
123124
{
124125
unsigned long flags_dis;
125126

@@ -139,7 +140,7 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long
139140
}
140141
}
141142

142-
static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock)
143+
static inline void __raw_spin_unlock(raw_spinlock_t *lock)
143144
{
144145
SYNC_IO;
145146
__asm__ __volatile__("# __raw_spin_unlock\n\t"
@@ -180,7 +181,7 @@ extern void __raw_spin_unlock_wait(raw_spinlock_t *lock);
180181
* This returns the old value in the lock + 1,
181182
* so we got a read lock if the return value is > 0.
182183
*/
183-
static long __inline__ __read_trylock(raw_rwlock_t *rw)
184+
static inline long __read_trylock(raw_rwlock_t *rw)
184185
{
185186
long tmp;
186187

@@ -204,7 +205,7 @@ static long __inline__ __read_trylock(raw_rwlock_t *rw)
204205
* This returns the old value in the lock,
205206
* so we got the write lock if the return value is 0.
206207
*/
207-
static __inline__ long __write_trylock(raw_rwlock_t *rw)
208+
static inline long __write_trylock(raw_rwlock_t *rw)
208209
{
209210
long tmp, token;
210211

@@ -224,7 +225,7 @@ static __inline__ long __write_trylock(raw_rwlock_t *rw)
224225
return tmp;
225226
}
226227

227-
static void __inline__ __raw_read_lock(raw_rwlock_t *rw)
228+
static inline void __raw_read_lock(raw_rwlock_t *rw)
228229
{
229230
while (1) {
230231
if (likely(__read_trylock(rw) > 0))
@@ -238,7 +239,7 @@ static void __inline__ __raw_read_lock(raw_rwlock_t *rw)
238239
}
239240
}
240241

241-
static void __inline__ __raw_write_lock(raw_rwlock_t *rw)
242+
static inline void __raw_write_lock(raw_rwlock_t *rw)
242243
{
243244
while (1) {
244245
if (likely(__write_trylock(rw) == 0))
@@ -252,17 +253,17 @@ static void __inline__ __raw_write_lock(raw_rwlock_t *rw)
252253
}
253254
}
254255

255-
static int __inline__ __raw_read_trylock(raw_rwlock_t *rw)
256+
static inline int __raw_read_trylock(raw_rwlock_t *rw)
256257
{
257258
return __read_trylock(rw) > 0;
258259
}
259260

260-
static int __inline__ __raw_write_trylock(raw_rwlock_t *rw)
261+
static inline int __raw_write_trylock(raw_rwlock_t *rw)
261262
{
262263
return __write_trylock(rw) == 0;
263264
}
264265

265-
static void __inline__ __raw_read_unlock(raw_rwlock_t *rw)
266+
static inline void __raw_read_unlock(raw_rwlock_t *rw)
266267
{
267268
long tmp;
268269

@@ -279,7 +280,7 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw)
279280
: "cr0", "memory");
280281
}
281282

282-
static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
283+
static inline void __raw_write_unlock(raw_rwlock_t *rw)
283284
{
284285
__asm__ __volatile__("# write_unlock\n\t"
285286
LWSYNC_ON_SMP: : :"memory");

0 commit comments

Comments
 (0)