Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp240197img; Mon, 18 Mar 2019 01:59:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoQu1cZVVAq3bN35wDVmR292wKGe54MhOyDqwltv713qkE09UpRf9hF+cB5eL/XHgC9TEQ X-Received: by 2002:a65:514a:: with SMTP id g10mr16828094pgq.400.1552899578645; Mon, 18 Mar 2019 01:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552899578; cv=none; d=google.com; s=arc-20160816; b=vk0LTvkaMK/DgsLR0TDXFp7qeI6OHzZs+eLgRx/nvn/MhVHgPUM1Cv3z/mxSQQh/hC dl0+2OqVRfpIWQKxhUsFTLOa9jvyDeCQ+kNNsxTRdhOjKNCD27y6bBx+Jx4GD4sns/FY 0YqJjiVVEmNkhTOP6Zi/zG0aB3FXbprIghTeFzJycd/fUM2OQHOrquLSQwC5rC2w5rAN oBRqq3ZRSRcwxKNZtWbbRO1S5gTPOMcgA4Ee2roL0QNJseP+0wPjGFLZQEPVdnq0E0fc roEylFwipBHioBGR+EPn/IFXijHCT9aJB3mmgMgCFKApyniJC30f3A8oTxEENRo7oYuz sxAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=1XLCw9PbTG5cmcCj0Lx2C8KpF/SggNGbCfQvyRLmgpU=; b=c3qJj9l6WhATfhqRrooER3P24m5/TegNQ0uX0wknoCB6q/Z8hjr5e401iEUgDtF7lT eR7vRO8WieLetGztgruqyREJG2TTpWPVdpcDvJWt22Y2wn6FayCnBq8TrdwGscZ4URNn nIxREphoOmb6ACq282yZ53YEMUHC/D5ogDiti8W7cnqPn31VEZcVO1BBBA1VxxoTflUu VGwHX8Up+rcuaFmqc9Q3yhJT5elzOJgPuV8afdx3sdewAgHz27QiNXXdVEnn7rLOmzUb 0BJ0m/Vt3KfJHaB5Mg7SXR+tlRAecMOnjeXzYYEcY23b+tO6D6U9Uzq5FPq927DiPMBb iukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VfcOhsiq; 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 f17si3249621pgb.231.2019.03.18.01.59.23; Mon, 18 Mar 2019 01:59:38 -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=VfcOhsiq; 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 S1727469AbfCRI6W (ORCPT + 99 others); Mon, 18 Mar 2019 04:58:22 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35276 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbfCRI6U (ORCPT ); Mon, 18 Mar 2019 04:58:20 -0400 Received: by mail-pg1-f193.google.com with SMTP id g8so261346pgf.2 for ; Mon, 18 Mar 2019 01:58:20 -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; bh=1XLCw9PbTG5cmcCj0Lx2C8KpF/SggNGbCfQvyRLmgpU=; b=VfcOhsiqNnKC6Rfx5p/G5E/s8VpUVhOVp054AkK1GidmKv3iEmsG+uTcpBzLFxDH1T Tp3YbB0ljv5PKFeMxlO4R1CTOxBXtE8YQcG4xDvJMtagpykgxipoRPanmRx7YGrWFpT+ ED4nDMqlmvENUMZBsXBfneoSFNNAOGdupFD9EHdKiOLTvNCqzh0uPVO9SPrnEqnIxRNJ z09/1skqx7RXlS2d4tThKsYjo4ODwPtBvbXO326ismT/qiDR+55uWTl7T4qEe/rC16mc JHp/Wcwv0zv9aoGlZXAV0UQ4Am6b40Dp17E94ghqVgHb2kQSLMHdQxcp9gJwTD1lcg/p 4twg== 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; bh=1XLCw9PbTG5cmcCj0Lx2C8KpF/SggNGbCfQvyRLmgpU=; b=b3VUAAFqwcTUAae1Y6j3Hsk7hjWvV8iIy5KDF29VX1m/iFK6qckVC7pxPzbNZoizt/ hAgkkYi3VfYniEMnFD/gCHCFTMclZV2vdTMVOiUmeA9vT+RdfKeiHXh1LzHiolj4e1dK DxVp0/N3Ono++rPn4rQLGZ1cvTJI8DFOGxRpQO9FsKFvuJilJPlLi6pOPFofflH2Wk+e cn3B8Cf0Y9uaOJ7iPyjU0/qly0Q6hBi06jzq7x0w8+qBguupKwh8FF2eanaodoKswWAi 3RzoYN9+t/23UmQxqcdp4tHfqOEaTPtz/63GJV6biKHEn39iK0LmytS9nGdcrBj/MtCk bO1A== X-Gm-Message-State: APjAAAU18hC6fPwxk7vEQvrwkCSGmKgzaEUiWDQu1FncB7vVlxGVpNkB SxfYnHmtZOfPZjaf15on8N8= X-Received: by 2002:a63:4550:: with SMTP id u16mr16311485pgk.73.1552899500164; Mon, 18 Mar 2019 01:58:20 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id k8sm11147024pgq.37.2019.03.18.01.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 01:58:19 -0700 (PDT) From: Yuyang Du To: peterz@infradead.org, will.deacon@arm.com, mingo@kernel.org Cc: bvanassche@acm.org, ming.lei@redhat.com, linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH v2 13/19] locking/lockdep: Remove unnecessary function pointer argument Date: Mon, 18 Mar 2019 16:57:27 +0800 Message-Id: <20190318085733.3143-14-duyuyang@gmail.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20190318085733.3143-1-duyuyang@gmail.com> References: <20190318085733.3143-1-duyuyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org check_prev_add() always has save_trace() as an input argument, which is unnecessary. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 250ba64..de731b8 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2190,8 +2190,7 @@ static void print_deadlock_scenario(struct held_lock *nxt, */ static int check_prev_add(struct task_struct *curr, struct held_lock *prev, - struct held_lock *next, int distance, struct stack_trace *trace, - int (*save)(struct stack_trace *trace)) + struct held_lock *next, int distance, struct stack_trace *trace) { struct lock_list *uninitialized_var(target_entry); struct lock_list *entry; @@ -2231,11 +2230,11 @@ static void print_deadlock_scenario(struct held_lock *nxt, if (unlikely(!ret)) { if (!trace->entries) { /* - * If @save fails here, the printing might trigger + * If save_trace fails here, the printing might trigger * a WARN but because of the !nr_entries it should * not do bad things. */ - save(trace); + save_trace(trace); } print_circular_bug(&this, target_entry, next, prev, trace); return 0; @@ -2290,7 +2289,7 @@ static void print_deadlock_scenario(struct held_lock *nxt, } - if (!trace->entries && !save(trace)) + if (!trace->entries && !save_trace(trace)) return 0; /* @@ -2355,7 +2354,7 @@ static void print_deadlock_scenario(struct held_lock *nxt, * added: */ if (hlock->read != 2 && hlock->check) { - int ret = check_prev_add(curr, hlock, next, distance, &trace, save_trace); + int ret = check_prev_add(curr, hlock, next, distance, &trace); if (!ret) return 0; -- 1.8.3.1