diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2013-01-24 21:53:17 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-02-23 03:51:04 +0000 |
commit | 45b5aba2c6a8fa9a62a35a3801b15e23b98f19d5 (patch) | |
tree | 49f0a2e3c9a6ed680b2724cc4af3d45555fefefb /include | |
parent | 5cc2ccd8af44dec092919615262b7dbe5850dcbb (diff) |
lockdep: Silence warning if CONFIG_LOCKDEP isn't set
commit 5cd3f5affad2109fd1458aab3f6216f2181e26ea upstream.
Since commit c9a4962881929df7f1ef6e63e1b9da304faca4dd ("nfsd:
make client_lock per net") compiling nfs4state.o without
CONFIG_LOCKDEP set, triggers this GCC warning:
fs/nfsd/nfs4state.c: In function ‘free_client’:
fs/nfsd/nfs4state.c:1051:19: warning: unused variable ‘nn’ [-Wunused-variable]
The cause of that warning is that lockdep_assert_held() compiles
away if CONFIG_LOCKDEP is not set. Silence this warning by using
the argument to lockdep_assert_held() as a nop if CONFIG_LOCKDEP
is not set.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: J. Bruce Fields <bfields@redhat.com>
Link: http://lkml.kernel.org/r/1359060797.1325.33.camel@x61.thuisdomein
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/lockdep.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 8b9bbf1d5b6e..8abaedffa901 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -394,7 +394,7 @@ struct lock_class_key { }; #define lockdep_depth(tsk) (0) -#define lockdep_assert_held(l) do { } while (0) +#define lockdep_assert_held(l) do { (void)(l); } while (0) #define lockdep_assert_held_once(l) do { (void)(l); } while (0) #endif /* !LOCKDEP */ |