From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbdFTNW7 (ORCPT ); Tue, 20 Jun 2017 09:22:59 -0400 Received: from terminus.zytor.com ([65.50.211.136]:39327 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbdFTNW6 (ORCPT ); Tue, 20 Jun 2017 09:22:58 -0400 Date: Tue, 20 Jun 2017 06:19:21 -0700 From: "tip-bot for Levin, Alexander (Sasha Levin)" Message-ID: Cc: alexander.levin@verizon.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org Reply-To: tglx@linutronix.de, torvalds@linux-foundation.org, alexander.levin@verizon.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org In-Reply-To: <20170618140548.4763-1-alexander.levin@verizon.com> References: <20170618140548.4763-1-alexander.levin@verizon.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/rtmutex: Don't initialize lockdep when not required Git-Commit-ID: cde50a67397c0da7d11795d4b4418384022ab8e6 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: cde50a67397c0da7d11795d4b4418384022ab8e6 Gitweb: http://git.kernel.org/tip/cde50a67397c0da7d11795d4b4418384022ab8e6 Author: Levin, Alexander (Sasha Levin) AuthorDate: Sun, 18 Jun 2017 14:06:01 +0000 Committer: Ingo Molnar CommitDate: Tue, 20 Jun 2017 11:53:09 +0200 locking/rtmutex: Don't initialize lockdep when not required pi_mutex isn't supposed to be tracked by lockdep, but just passing NULLs for name and key will cause lockdep to spew a warning and die, which is not what we want it to do. Skip lockdep initialization if the caller passed NULLs for name and key, suggesting such initialization isn't desired. Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: f5694788ad8d ("rt_mutex: Add lockdep annotations") Link: http://lkml.kernel.org/r/20170618140548.4763-1-alexander.levin@verizon.com Signed-off-by: Ingo Molnar --- kernel/locking/rtmutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 4312353..7806989 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1661,7 +1661,8 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name, lock->waiters = RB_ROOT; lock->waiters_leftmost = NULL; - debug_rt_mutex_init(lock, name, key); + if (name && key) + debug_rt_mutex_init(lock, name, key); } EXPORT_SYMBOL_GPL(__rt_mutex_init);