lkml.org 
[lkml]   [2014]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH] sgi-xp: Do not use BUG_ON(!spin_is_locked())
Date
Opps ! Thanks for review comment. Just sent V2 updated patch.

Sanjeev Sharma

-----Original Message-----
From: Ryan Mallon [mailto:rmallon@gmail.com]
Sent: Wednesday, August 20, 2014 4:34 AM
To: Sharma, Sanjeev; cpw@sgi.com; robinmholt@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sgi-xp: Do not use BUG_ON(!spin_is_locked())

On 12/08/14 17:35, Sanjeev Sharma wrote:
> on some architecture spin_is_locked() always return false in
> uniprocessor configuration and can therefore not be used with
> BUG_ON.it would be advise to replace with lockdep_assert_held().
>
> Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com>
> ---
> drivers/misc/sgi-xp/xpc_channel.c | 6 +++---
> drivers/misc/sgi-xp/xpc_sn2.c | 2 +-
> drivers/misc/sgi-xp/xpc_uv.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/misc/sgi-xp/xpc_channel.c
> b/drivers/misc/sgi-xp/xpc_channel.c
> index 128d561..240fe5a 100644
> --- a/drivers/misc/sgi-xp/xpc_channel.c
> +++ b/drivers/misc/sgi-xp/xpc_channel.c
> @@ -28,7 +28,7 @@ xpc_process_connect(struct xpc_channel *ch, unsigned
> long *irq_flags) {
> enum xp_retval ret;
>
> - DBUG_ON(!spin_is_locked(&ch->lock));
> + lockdep_assert_held(!spin_is_locked(&ch->lock));

This is incorrect, and will break the build with CONFIG_LOCKDEP enabled.
You actually want:

lockdep_assert_held(&ch->lock);

Same for the other instances.

~Ryan


\
 
 \ /
  Last update: 2014-08-20 08:01    [W:0.058 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site