Skip to content

Commit

Permalink
lockdep: Silence warning if CONFIG_LOCKDEP isn't set
Browse files Browse the repository at this point in the history
Since commit c9a4962 ("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 <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stanislav Kinsbursky <[email protected]>
Cc: J. Bruce Fields <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
--
 include/linux/lockdep.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Change-Id: Ibb08987ea582ee2f9cecff2e66ab1cb957cabf98
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
pebolle authored and franciscofranco committed Dec 9, 2017
1 parent 1959830 commit b2f94b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,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_recursing(tsk) (0)

Expand Down

0 comments on commit b2f94b2

Please sign in to comment.