lkml.org 
[lkml]   [2016]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2016-12-06 16:15    [W:0.239 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site