Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2202186yba; Mon, 6 May 2019 01:23:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWjoR21abK2paV7Tnf2xr7f6jkE2z3cd0K+yevEQDm0iRVQcEeocBwZ6ddOuFeGl8IIGOm X-Received: by 2002:a63:5057:: with SMTP id q23mr30833897pgl.30.1557130993970; Mon, 06 May 2019 01:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557130993; cv=none; d=google.com; s=arc-20160816; b=QLpVpsFwOzNEJrEpwdXyUX/DP+WA5WSuEGYWYsruIdBbWKrCS95rJYXbMaadPqtwn0 QoISPvaYqw7aYOeZMTOdBwW3cmFjrp9pFMgz9kKoImgyHTuSP3/m1MaJvtGNweXBwQgt 6wYjBUcsYvHJuMHF6j8Oue3fQAWHEkhhHn7acLX+/SGU/SDAALFXbkj/4mpeQ50xdwX2 iC2O5tR+gisfexg8JPNkDFD6z8vUNCvTTzcxQpxS39C4JzPjkhVHizGqbEoe0DF3UNgQ VGTJnaR2EQt2ratrdLCR7zKqATzjB14JgyaHFWIm9sCqrq/EZyXBYdSDOiSfmIQ6MgFE aLOA== 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=QKYp824sV52iVA5xCpuAmZ1milKgy4gJjXqB3YKplKQ=; b=r0pALRV3+nf18wWRZuWTXF7Q4Z/dtReUB7Dv/+d1XQNuTV88ZrU+0ntQNZr8EBh1o6 cPhnS6MnjDbDZdMGs6V3SzUCz+yy0ran9dHGAY3Uk8A68H4ikrigVWaKBIH35a8W2vlT DJ6zWpYgWvqHD+L7zgUqmacAvBcjqJOSaEGJUVDmvygccy+kA9whrbC8d4+nC62V7LkA 5EFS8rSHuq+H8lwph5Ax6+RODSPzpDK1DfqUG1CUvEtVe4lk6kqMFqgUnQYQgrmJ41f/ McAKN37MYMPziO5PWZT07cxVEb13a1blC7EIdPWxF5E0QXNeRhNTiIen4LQXjrJeUHAd 47vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LYrnxC+R; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u67si10003329pfu.154.2019.05.06.01.22.58; Mon, 06 May 2019 01:23:13 -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=@gmail.com header.s=20161025 header.b=LYrnxC+R; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfEFIUp (ORCPT + 99 others); Mon, 6 May 2019 04:20:45 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41665 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbfEFIUo (ORCPT ); Mon, 6 May 2019 04:20:44 -0400 Received: by mail-pg1-f194.google.com with SMTP id z3so2386924pgp.8 for ; Mon, 06 May 2019 01:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QKYp824sV52iVA5xCpuAmZ1milKgy4gJjXqB3YKplKQ=; b=LYrnxC+RUl1AAvsFrPANYyFpmGaeZaKA2Omy4NayExV/OtWjJX+Pp02UcjWWeYaJ6W ui020TlrTCzKPIhmSky/bxGGo0pRHwzS3UvRyNJaqeW2eLK8fQNYcq6HR11jHS5TKAeQ A8Ce8NpCd6u6bjkWBJAwti1tVqEH2bGo5py2b9jzfLwT9JfOURzUyr5m6Ub+D75LOGB6 FkdDT36OL8Kr8DFc4YDHr5tt5MOBKKFJ8BFtOFO6skbaV3/v4LU+etwOzL7958zbZuCl J0CttbzArUXrKaRscmkORA+ziFaIEshKR8Lb5fj5wLqJ/cS5fVrNva91rNqIpq+jwS09 pUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QKYp824sV52iVA5xCpuAmZ1milKgy4gJjXqB3YKplKQ=; b=Buqcvdwkh/pG63765I92Q2UrwkLaUBclM9+dyOAMH/gUd7lUHk/xXPL1KFH+YpT/Jb vbVBjLS8CpOO7RaW1bLPl6AC4RiEZnTPzjktza4Yw1E14jEQTvwduAwJK6DiLjEc3x8+ cFlQuGFg1I48iSTEPoR3PFl0N5vZJx6sWKqQLTkzGtC7aoLEUgYo6O1yYZhpUUGsGigS EjekIjUBpZNa5n8fL1eWd4lE5sMNjMfxjCb3fE+khEgaG4YshNMC+5inpq6A3c/pzxrN 5ZltuUKDWxudxEthGyDM9Xxx8oumDoAB5AJPDa5bGSQIMLrbVcebmmCTXXhaCkEITupJ Q/TQ== X-Gm-Message-State: APjAAAUfXYW2r2J58H4XZOGcnxbjBl++/uHyfqbSfXjJHMO/V48XENQI ITcsaVfv6RJSoDmp8LkV6yw= X-Received: by 2002:a63:dc50:: with SMTP id f16mr30552874pgj.396.1557130843097; Mon, 06 May 2019 01:20:43 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id v19sm20958013pfa.138.2019.05.06.01.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 01:20:42 -0700 (PDT) From: Yuyang Du To: peterz@infradead.org, will.deacon@arm.com, mingo@kernel.org Cc: bvanassche@acm.org, ming.lei@redhat.com, frederic@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH v2 17/23] locking/lockdep: Remove redundant argument in check_deadlock Date: Mon, 6 May 2019 16:19:33 +0800 Message-Id: <20190506081939.74287-18-duyuyang@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190506081939.74287-1-duyuyang@gmail.com> References: <20190506081939.74287-1-duyuyang@gmail.com> 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 In check_deadlock(), the third argument read comes from the second argument hlock so that it can be removed. No functional change. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 7bd62e2..67b6a76 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2241,7 +2241,7 @@ static inline void inc_chains(void) * Returns: 0 on deadlock detected, 1 on OK, 2 on recursive read */ static int -check_deadlock(struct task_struct *curr, struct held_lock *next, int read) +check_deadlock(struct task_struct *curr, struct held_lock *next) { struct held_lock *prev; struct held_lock *nest = NULL; @@ -2260,7 +2260,7 @@ static inline void inc_chains(void) * Allow read-after-read recursion of the same * lock class (i.e. read_lock(lock)+read_lock(lock)): */ - if ((read == 2) && prev->read) + if ((next->read == 2) && prev->read) return 2; /* @@ -2834,7 +2834,7 @@ static int validate_chain(struct task_struct *curr, * The simple case: does the current hold the same lock * already? */ - int ret = check_deadlock(curr, hlock, hlock->read); + int ret = check_deadlock(curr, hlock); if (!ret) return 0; -- 1.8.3.1