From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbcDNBW7 (ORCPT ); Wed, 13 Apr 2016 21:22:59 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34249 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbcDNBW6 (ORCPT ); Wed, 13 Apr 2016 21:22:58 -0400 From: Yang Shi To: peterz@infradead.org, mingo@redhat.com Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org Subject: [PATCH] lockdep: Include print_collision and helper functions in DEBUG_LOCKDEP Date: Wed, 13 Apr 2016 17:57:26 -0700 Message-Id: <1460595446-3010-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pint_collosion and helper functions are just used when DEBUG_LOCKDEP is selected, so include them in #ifdef CONFIG_DEBUG_LOCKDEP to avoid the below "defined but not used" warning when DEBUG_LOCKDEP is off: kernel/locking/lockdep.c:2051:13: warning: 'print_collision' defined but not used [-Wunused-function] static void print_collision(struct task_struct *curr, Signed-off-by: Yang Shi --- kernel/locking/lockdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 2324ba5..ed94109 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1999,6 +1999,7 @@ static inline int get_first_held_lock(struct task_struct *curr, return ++i; } +#ifdef CONFIG_DEBUG_LOCKDEP /* * Returns the next chain_key iteration */ @@ -2069,6 +2070,7 @@ static void print_collision(struct task_struct *curr, printk("\nstack backtrace:\n"); dump_stack(); } +#endif /* * Checks whether the chain and the current held locks are consistent -- 2.0.2