All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] lockdep: provide always true lockdep_is_held stub if lockdep disabled
@ 2016-04-07 23:12 Hannes Frederic Sowa
  2016-04-07 23:21 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Frederic Sowa @ 2016-04-07 23:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, Peter Zijlstra, Ingo Molnar, Eric Dumazet, David Miller

I need this to provide a generic lockdep_sock_is_held function which can
be easily used in the kernel without using ifdef PROVEN macros.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
Hello Peter and Ingo,

if it is possible coud this go in via the net-tree, as this problem is
visible there already? Would be happy to get a review.

Thanks,
Hannes

 include/linux/lockdep.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index d026b190c53066..dc8d447cb3ab1c 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -428,6 +428,8 @@ struct lock_class_key { };
 #define lockdep_pin_lock(l)				do { (void)(l); } while (0)
 #define lockdep_unpin_lock(l)			do { (void)(l); } while (0)
 
+#define lockdep_is_held(l)			({ (void)(l); (1); })
+
 #endif /* !LOCKDEP */
 
 #ifdef CONFIG_LOCK_STAT
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] lockdep: provide always true lockdep_is_held stub if lockdep disabled
  2016-04-07 23:12 [PATCH net] lockdep: provide always true lockdep_is_held stub if lockdep disabled Hannes Frederic Sowa
@ 2016-04-07 23:21 ` Hannes Frederic Sowa
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Frederic Sowa @ 2016-04-07 23:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, Peter Zijlstra, Ingo Molnar, Eric Dumazet, David Miller

On 08.04.2016 01:12, Hannes Frederic Sowa wrote:
> I need this to provide a generic lockdep_sock_is_held function which can
> be easily used in the kernel without using ifdef PROVEN macros.
>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
> Hello Peter and Ingo,
>
> if it is possible coud this go in via the net-tree, as this problem is
> visible there already? Would be happy to get a review.

I take this patch back, as some call sites test if the lock is 
definitely not held. I come up with a better approach.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 23:12 [PATCH net] lockdep: provide always true lockdep_is_held stub if lockdep disabled Hannes Frederic Sowa
2016-04-07 23:21 ` Hannes Frederic Sowa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.