From patchwork Thu Apr 14 00:57:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 65768 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp324640qge; Wed, 13 Apr 2016 18:23:01 -0700 (PDT) X-Received: by 10.98.74.74 with SMTP id x71mr17294107pfa.25.1460596981294; Wed, 13 Apr 2016 18:23:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26si4261319pfi.70.2016.04.13.18.23.01; Wed, 13 Apr 2016 18:23:01 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbcDNBW7 (ORCPT + 29 others); 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 Received: by mail-pa0-f45.google.com with SMTP id ot11so39643675pab.1 for ; Wed, 13 Apr 2016 18:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=f5fkolsT/BG5EDsZe0CHyCBwlEmuV7Q8SijJJTUPJTA=; b=Vcr4ZpWzZIYk6/6J30THYttiteLasTdbz5zwqe+g05PvMVgfDMfgvojuUMZbLSHVCo vX5IgArJRwtTmo6CCqoeGnUFPabJEx7apR2kDQUbxeLZrvVkBlg6RAgobySmzDURdCVg aHBq9+zeZKklrLcnprBuA2Zv6L62rh7e5LrQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=f5fkolsT/BG5EDsZe0CHyCBwlEmuV7Q8SijJJTUPJTA=; b=Fou4TtixUJNigTKHqeCM80XSMV0uYuVtiW5FLHGu/91GbdFoSygeXJoAdJwQE/qFwC YJ/5pHbW6BYOmpx5W/+hkYjAlDwr4bIFfS+++hYTukzww7Wgfc55R+Ci4F1lKatjnHOV OgFqybT8hU2Hfoiq+D7VPwkdqhuhbbYyyBSCcBstuVJgor9ExjQ5mg4OhzvoPy+pdU1z bXn2UnfsMFDF4Z0eVTHd25/+PdN7hLECZf5Xl4BP/Z64BmGEASh2TMEyw4sNnO8quQB2 SuVPPk3wDfOqglcx4lyYpdnkQ+FqgT3l1IW+gWTgxXZHwZFHGPWjJ60MNLBxX4i/PD9t 0oXw== X-Gm-Message-State: AOPr4FVZL9E6mD1TU3Unt9XioP+HuH965Xx8v7kjm8mlfv4qsc+39CBRSSKjN3sAKLsjwSkV X-Received: by 10.66.118.166 with SMTP id kn6mr17181385pab.33.1460596977371; Wed, 13 Apr 2016 18:22:57 -0700 (PDT) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id x18sm8260410pfi.81.2016.04.13.18.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Apr 2016 18:22:56 -0700 (PDT) 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 Precedence: bulk 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(+) -- 2.0.2 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