Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4447749ybi; Mon, 3 Jun 2019 11:01:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4gBBpQtXtdTCzkWT6Zi63u5kiHI+du9KKZVWFBNY9XqRP0SUNx11ftq0Tczrrdh1GMi0t X-Received: by 2002:a17:90a:23ce:: with SMTP id g72mr25514166pje.77.1559584895250; Mon, 03 Jun 2019 11:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559584895; cv=none; d=google.com; s=arc-20160816; b=MvaQNygOkblwgLWmFEgDIaiF66oapUHZE3RGFRO7lr7n9t7pJ5hWZiAjacXyYc9j+S ME7ZFxCG4ebGTmNYSC2Y3Y7v9F18h6+kREhjoMZFyePQdJE1kZScGN7GySFRNMUKP+8w D//ultGQEWWpFVOxILaU039FB56njlLb67cKNNrMoWaDNcsy8ZlJJ8R36JfrcGcY3sZK JhUMQdpOeu9f74pSV5HPB9jpDoE6LwEB2+jIQZk1V7ZODYBqOVoPF9yDiX6a8eMKvqwd S1vHS9soon9Ya8xEz1mANVL4L36aHUjwViXAomdRVFLK4jTOE/sqUWzf9/29ljrWQYF3 RYlw== 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=qQju9tIEAxgAVY0b0Mb/QeR42zB5EUie62cCkeZ7QEU=; b=NP04pRFoUrVI9yRuwk6kYmloLgWQqO2nVDDSxc5/pjFvL3riIuZYEdQply00VuY+V9 mkyaGoIowQ9+OM3lfT7F2h0/KfcLk+sdlX0Q/MPC0uo4dDPpd12B/3+JBLu2QWXyynjo ms//z1gwY0su7bDTVqEpbLcjV46OTBxVU4DPFSA0TRld7SdBfx+g2iU2ja7HHqb0QiIU 4nH0qGIULE7brvnQR+xN+dcILtaaAKxeeik0VuXVLlAvqS/TYVgaESSkm2hN8FKQht97 3VnkQT3uV9nR8ydOQNSilCixgfNpvMm1M5AOFJO6wpxgoBGnzocseW68VHNTcnh3sg+c wpnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=nZKgY2O3; 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 q14si16605660pgm.524.2019.06.03.11.01.18; Mon, 03 Jun 2019 11:01:35 -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=2019051801 header.b=nZKgY2O3; 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 S1728441AbfFCNSO (ORCPT + 99 others); Mon, 3 Jun 2019 09:18:14 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43439 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfFCNSO (ORCPT ); Mon, 3 Jun 2019 09:18:14 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DI4c3606461 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:18:04 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DI4c3606461 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559567885; bh=qQju9tIEAxgAVY0b0Mb/QeR42zB5EUie62cCkeZ7QEU=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=nZKgY2O3MfvdGUSTbqkyzSQdVlp5k2Ar+P3IIMElY7H82hdpHER/BQe/XA/fUyh4H F+VC3Pkb4pupqplNvHzpbTPbGLKhEZC6ZrVJYzE69ZpFYSRekLc+lK+hkNtGvDEKyS oCz2b+aKN4ASp299tkl8i4N/nqTIth5sugPr7NPOcF/kuJRA3gBYJvTiDNziLWyjKN 3xCX8j+NHAeoJOqdaGRNr9AtcrI6qJBa3az0LwKSgYaPU+cxkbl9/GfMqMWspfL1XK bydlbHaM603DDRD0+ciF0sJrRhQUFF9Dth6ljnygD3Ywm6BB9JsTBK11W9j1dYQjH+ rdm1hNBHhiu/A== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53DI43r606458; Mon, 3 Jun 2019 06:18:04 -0700 Date: Mon, 3 Jun 2019 06:18:04 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Yuyang Du Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, duyuyang@gmail.com, hpa@zytor.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: tglx@linutronix.de, torvalds@linux-foundation.org, peterz@infradead.org, hpa@zytor.com, duyuyang@gmail.com, linux-kernel@vger.kernel.org, mingo@kernel.org In-Reply-To: <20190506081939.74287-18-duyuyang@gmail.com> References: <20190506081939.74287-18-duyuyang@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Remove redundant argument in check_deadlock Git-Commit-ID: 4609c4f963f353613812f999bb027aac795bcde8 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.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO 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: 4609c4f963f353613812f999bb027aac795bcde8 Gitweb: https://git.kernel.org/tip/4609c4f963f353613812f999bb027aac795bcde8 Author: Yuyang Du AuthorDate: Mon, 6 May 2019 16:19:33 +0800 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 11:55:49 +0200 locking/lockdep: Remove redundant argument in check_deadlock 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: bvanassche@acm.org Cc: frederic@kernel.org Cc: ming.lei@redhat.com Cc: will.deacon@arm.com Link: https://lkml.kernel.org/r/20190506081939.74287-18-duyuyang@gmail.com Signed-off-by: Ingo Molnar --- 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 b2ca20aa69aa..be4c1348ddcd 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2246,7 +2246,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, * 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; @@ -2265,7 +2265,7 @@ check_deadlock(struct task_struct *curr, struct held_lock *next, int read) * 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; /* @@ -2839,7 +2839,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;