Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp463788yba; Thu, 18 Apr 2019 04:27:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYio4PgiwBaI+XKTWrfNZYve7IKn4YBAa0/lac/eWTjPLMh1S019MDNy+w2I92EnJaf4RB X-Received: by 2002:aa7:8289:: with SMTP id s9mr94656345pfm.208.1555586850943; Thu, 18 Apr 2019 04:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555586850; cv=none; d=google.com; s=arc-20160816; b=hEIOsR195IFF54Otn+OLufIiMODv3Yduo++oyoTh6mrLwfX6zP+MCWPM6mlVp33yIc OHNlkex3FKutXJ/T6YSDDqcicvpDAUZIN+fA5MtefC2Pu+Q76h5M6PI9OjeeJ3zVbAKK 0+4wzhcR72srUHcWGbQa595t/xMEQl1PXliIeC9A9B5Gpa0jyHkVNAsZWHUd58O0nxgm C4Nr/sAZ7eRgkzKhgtC9OzLip1ggMJbUSDFB7U3eQcOKVZwWxr/hLtY6AP6GbRYhJFm8 J4HbvsxiHJdwSbS+tbMeFUGbSvpUV5U7bsCWutbYr0HGUMvM3ipZ4S5TGCko2vxZ27+K 4FhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=aG75LDi+S/MLkFq6ZRzL6s1NCKZSoTNA0rV7fYcp8s4=; b=Y1C9SULPZLA5KLJks/Kwopvnj5at8/3+jnwVNlB56ttknE+xcE0xNsKJEA4C5Mbo1I oZD79wfmQgMkmPpIQ+H7Q9fUU2p+monRv5prI+YR6/wAfz4DUWdxslbOQ8ALUemr52Ip eaIIHZaI1TbIW9OUTnpY1Gt3l03Z6dQE6FRCNMkH04m4COic4VcV9vDYmyWbI5a0xGAI m2WvYAzdrijFMvR1O8xQsrggNJt+FfqC5/28mACmJJurDA2WpZQ+bVWyHcN0smNDQmIP VNKiP2RV64i7mlltMd+moWmCl97ZhASFIZp4SpcBOmiffYWQcOU5S041QzRTGoWuUwqU aexg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=VtmWPyO8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si1706005pga.257.2019.04.18.04.27.15; Thu, 18 Apr 2019 04:27:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=VtmWPyO8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388819AbfDRL0X (ORCPT + 99 others); Thu, 18 Apr 2019 07:26:23 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40525 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfDRL0W (ORCPT ); Thu, 18 Apr 2019 07:26:22 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3IBQ5iO166649 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Apr 2019 04:26:05 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3IBQ5iO166649 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1555586766; bh=aG75LDi+S/MLkFq6ZRzL6s1NCKZSoTNA0rV7fYcp8s4=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=VtmWPyO8YodinRU+8RfkGCbmwFFUFbJK0CsC1LgeuG9vPApneyYBErgk+FeN/iopb ZnvQzJiuxBxpRCQcqve2Y8+eWwCalNv5cN8qIMa9tdtuYwdtGJ9gJmyEwXqCpByVZ0 zxrntZ24+1gl2IN5EdkZXSSX2tyeR478AeLr5+4DZJ9HTRapXFu4zkTu/UpcM9BLSz zub9p5mc/3X/fZfju21UXawPzckkjqrptRR2km1FcuI0mGntccmKaDaOr842Gjze+H yRXfuUUF4ktqJorbc+lfduqdzYiyiEL3TLOuDTwIR0Vqhr/lS9io1CAefAKpVW3znQ xzR+FP4pVSbnA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3IBQ419166645; Thu, 18 Apr 2019 04:26:04 -0700 Date: Thu, 18 Apr 2019 04:26:04 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Frederic Weisbecker Message-ID: Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org, frederic@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, will.deacon@arm.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, frederic@kernel.org, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org In-Reply-To: <20190402160244.32434-2-frederic@kernel.org> References: <20190402160244.32434-2-frederic@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING Git-Commit-ID: 0d2cc3b3453254f1c56f9456ba03e092ed4cfb72 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 X-Spam-Status: No, score=0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_12_24,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0d2cc3b3453254f1c56f9456ba03e092ed4cfb72 Gitweb: https://git.kernel.org/tip/0d2cc3b3453254f1c56f9456ba03e092ed4cfb72 Author: Frederic Weisbecker AuthorDate: Tue, 2 Apr 2019 18:02:41 +0200 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 12:50:17 +0200 locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING valid_state() and print_usage_bug*() functions are not used beyond irq locking correctness checks under CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING. Sadly the "unused function" warning wouldn't fire because valid_state() is inline so the unused case has remained unseen until now. So move them inside the appropriate CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING section. Signed-off-by: Frederic Weisbecker Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Link: https://lkml.kernel.org/r/20190402160244.32434-2-frederic@kernel.org Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 34cdcbedda49..9c5819ef4a28 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2784,6 +2784,12 @@ static void check_chain_key(struct task_struct *curr) #endif } +static int mark_lock(struct task_struct *curr, struct held_lock *this, + enum lock_usage_bit new_bit); + +#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) + + static void print_usage_bug_scenario(struct held_lock *lock) { @@ -2853,10 +2859,6 @@ valid_state(struct task_struct *curr, struct held_lock *this, return 1; } -static int mark_lock(struct task_struct *curr, struct held_lock *this, - enum lock_usage_bit new_bit); - -#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) /* * print irq inversion bug: