Patchwork Remove unused spin_trylock() function

login
register
mail settings
Submitter Peter Maydell
Date Dec. 1, 2010, 7:44 p.m.
Message ID <1291232678-31556-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/73897/
State New
Headers show

Comments

Peter Maydell - Dec. 1, 2010, 7:44 p.m.
Remove the spin_trylock() function, as it is not used anywhere,
and is not even implemented if CONFIG_USE_NPTL is defined.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 qemu-lock.h |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
Blue Swirl - Dec. 5, 2010, 8:23 a.m.
Thanks, applied.

On Wed, Dec 1, 2010 at 7:44 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Remove the spin_trylock() function, as it is not used anywhere,
> and is not even implemented if CONFIG_USE_NPTL is defined.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  qemu-lock.h |   10 ----------
>  1 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/qemu-lock.h b/qemu-lock.h
> index 9a3e6ac..65ca084 100644
> --- a/qemu-lock.h
> +++ b/qemu-lock.h
> @@ -224,11 +224,6 @@ static inline void spin_unlock(spinlock_t *lock)
>  {
>     resetlock(lock);
>  }
> -
> -static inline int spin_trylock(spinlock_t *lock)
> -{
> -    return !testandset(lock);
> -}
>  #else
>  static inline void spin_lock(spinlock_t *lock)
>  {
> @@ -237,11 +232,6 @@ static inline void spin_lock(spinlock_t *lock)
>  static inline void spin_unlock(spinlock_t *lock)
>  {
>  }
> -
> -static inline int spin_trylock(spinlock_t *lock)
> -{
> -    return 1;
> -}
>  #endif
>
>  #endif
> --
> 1.7.1
>
>
>

Patch

diff --git a/qemu-lock.h b/qemu-lock.h
index 9a3e6ac..65ca084 100644
--- a/qemu-lock.h
+++ b/qemu-lock.h
@@ -224,11 +224,6 @@  static inline void spin_unlock(spinlock_t *lock)
 {
     resetlock(lock);
 }
-
-static inline int spin_trylock(spinlock_t *lock)
-{
-    return !testandset(lock);
-}
 #else
 static inline void spin_lock(spinlock_t *lock)
 {
@@ -237,11 +232,6 @@  static inline void spin_lock(spinlock_t *lock)
 static inline void spin_unlock(spinlock_t *lock)
 {
 }
-
-static inline int spin_trylock(spinlock_t *lock)
-{
-    return 1;
-}
 #endif
 
 #endif