Skip to content

Commit

Permalink
lockref: include mutex.h rather than reinvent arch_mutex_cpu_relax
Browse files Browse the repository at this point in the history
arch_mutex_cpu_relax is already conditionally defined in mutex.h, so
simply include that header rather than replicate the code here.

Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
wildea01 authored and torvalds committed Nov 28, 2013
1 parent dad3375 commit 14058d2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/lockref.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <linux/export.h>
#include <linux/lockref.h>
#include <linux/mutex.h>

#if USE_CMPXCHG_LOCKREF

Expand All @@ -11,14 +12,6 @@
# define cmpxchg64_relaxed cmpxchg64
#endif

/*
* Allow architectures to override the default cpu_relax() within CMPXCHG_LOOP.
* This is useful for architectures with an expensive cpu_relax().
*/
#ifndef arch_mutex_cpu_relax
# define arch_mutex_cpu_relax() cpu_relax()
#endif

/*
* Note that the "cmpxchg()" reloads the "old" value for the
* failure case.
Expand Down

0 comments on commit 14058d2

Please sign in to comment.