Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421009

Re: [PATCH] staging: gdm724x: Replace semaphore netlink with mutex

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: gdm724x: Replace semaphore netlink with mutex
Date 2016-06-13 17:50 +0200
Message-ID <rJChH-8go-9@gated-at.bofh.it> (permalink)
References <rJBbY-7vM-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Monday, June 13, 2016 7:59:20 PM CEST Binoy Jayan wrote:
> 
> -#if defined(DEFINE_MUTEX)
> -static DEFINE_MUTEX(netlink_mutex);
> -#else
> -static struct semaphore netlink_mutex;
> -#define mutex_lock(x)          down(x)
> -#define mutex_unlock(x)                up(x)
> -#endif
> +static struct mutex netlink_mutex;
> 

Good catch! I think the patch is correct, but the DEFINE_MUTEX
here seems preferable over the runtime mutex_init() call.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: gdm724x: Replace semaphore netlink with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 16:40 +0200
  Re: [PATCH] staging: gdm724x: Replace semaphore netlink with mutex Arnd Bergmann <arnd@arndb.de> - 2016-06-13 17:50 +0200
  [PATCH v2] staging: gdm724x: Replace semaphore netlink with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:50 +0200

csiph-web