[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161206151459.GU3045@worktop.programming.kicks-ass.net>
Date: Tue, 6 Dec 2016 16:14:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Nicolai Hähnle <nhaehnle@...il.com>
Cc: linux-kernel@...r.kernel.org,
Nicolai Hähnle <Nicolai.Haehnle@....com>,
Ingo Molnar <mingo@...hat.com>,
Maarten Lankhorst <dev@...ankhorst.nl>,
Daniel Vetter <daniel@...ll.ch>,
Chris Wilson <chris@...is-wilson.co.uk>,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v2 04/11] locking/ww_mutex: Set use_ww_ctx even when
locking without a context
On Thu, Dec 01, 2016 at 03:06:47PM +0100, Nicolai Hähnle wrote:
> +++ b/include/linux/ww_mutex.h
> @@ -222,11 +222,7 @@ extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
> */
> static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
> {
> - if (ctx)
> - return __ww_mutex_lock(lock, ctx);
> -
> - mutex_lock(&lock->base);
> - return 0;
> + return __ww_mutex_lock(lock, ctx);
> }
>
> /**
> @@ -262,10 +258,7 @@ static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ct
> static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
> struct ww_acquire_ctx *ctx)
> {
> - if (ctx)
> - return __ww_mutex_lock_interruptible(lock, ctx);
> - else
> - return mutex_lock_interruptible(&lock->base);
> + return __ww_mutex_lock_interruptible(lock, ctx);
> }
>
After this the entire point of __ww_mutex_lock*() is gone, right? Might
as well rename them to ww_mutex_lock() and remove this pointless
wrapper.
Powered by blists - more mailing lists