Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1450196yba; Tue, 2 Apr 2019 09:05:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqznCNhN5grjDDxqYOSlc4u0ZERPelIuqt3Em+IK3lCi1E5T4ibIGwYkmkrAZctFXq2LQivz X-Received: by 2002:a62:41dc:: with SMTP id g89mr67799155pfd.109.1554221136025; Tue, 02 Apr 2019 09:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554221136; cv=none; d=google.com; s=arc-20160816; b=myc4vNp6IDZiYdQoDJvmbEiEmZmLfjMZrgqXDTe2IKlRuyNFbgZD8i/hEYfXlMTXc5 hUGkSQtNd4SycGefbFyA9QYb1N7CMzZK3BsO/SAuwOlhdPDU0w9tjhskKvl6SwknWKEG zLiEMvicnFHSc0Z7p+/awmjM/E7tzGXp6eqAgQKa0ttYEe2GNzU1e+X65DMYTF170lgT JMdgvc1KbuG24DbA5aEXkqUhyfsVNIpmj4q7Ht6TFck0VuinaqYbrrcvEJDXk/dOeDAs y9T15LYlY7IKNoVI+FjnRVcWpWnhCD8iwHV/RVip3F3fJ0od8nX2zq2Nb56QmIU4RUuy yCDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rST5eOlk7t7LbgiMLYrhdLIFYLzbGSYIl3/3ts1HR+k=; b=oUekuBOl5/VDeZ148YbCtIQCX33+LbH96Xr/o8qR4tX2R2ZPXBSn8u6J+Chz3DST7J 2blM6s+FOOO1qHoq8XE3i/e/JlA3/3WwHqqtAYMt16/eZn5QuTT44yU5ktCpcowiSP1a L+rS6q4k3Bw+5hv7O5iwV1gtPtd1E4P9vb9YmIQyB7UwJq0IY6E6qFQVoph95I51DB7I 46L4u0ZiwwfM1Vw2Rz5IhPiF4lpchCixujRolfDUQp5fZ7dmI2e5TxO4b4Ur1/er+fhY PYLEhsgaOvWGPUI6OZiGYbUmrlrjsfxJUlKhsyTk3ScuunzIXsHC/Rri7+tv7TIB5AyE nJQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=StmfowuH; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si11221720plo.118.2019.04.02.09.05.20; Tue, 02 Apr 2019 09:05:36 -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=@kernel.org header.s=default header.b=StmfowuH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730332AbfDBQC4 (ORCPT + 99 others); Tue, 2 Apr 2019 12:02:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729060AbfDBQCy (ORCPT ); Tue, 2 Apr 2019 12:02:54 -0400 Received: from lenoir.home (lfbn-1-18527-45.w90-101.abo.wanadoo.fr [90.101.69.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F20B20840; Tue, 2 Apr 2019 16:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554220973; bh=pHkwdNRsjNDAbq6he40wqMIDRU0Idtw3/CZrsqj7p/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StmfowuHc+IYGT3F3dY455qByAhrA0A0WzMfOGV8sk37SRDanuSihhuNjqLN0vSef +evlIVx05raHiyVgK/NdTkkzyVBUdmVCF3B1aggswEqU8/RK5XkHmubj2MJCJVxcBN WjTQzT0lxNgGt7NyaNXjrvbBs4419RiVXUuYAdFI= From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Ingo Molnar , Peter Zijlstra Subject: [PATCH 1/4] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING Date: Tue, 2 Apr 2019 18:02:41 +0200 Message-Id: <20190402160244.32434-2-frederic@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190402160244.32434-1-frederic@kernel.org> References: <20190402160244.32434-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Ingo Molnar Cc: Peter Zijlstra --- 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: -- 2.21.0