Messages in this thread | | | Date | Wed, 20 Aug 2014 09:04:19 +1000 | From | Ryan Mallon <> | 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
| |