From patchwork Thu Apr 25 09:45:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 10916611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98EB31805 for ; Thu, 25 Apr 2019 10:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8789B28A08 for ; Thu, 25 Apr 2019 10:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79EA828A28; Thu, 25 Apr 2019 10:00:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC90528AB0 for ; Thu, 25 Apr 2019 10:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D31136B0270; Thu, 25 Apr 2019 05:59:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CE1976B0271; Thu, 25 Apr 2019 05:59:35 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5C4A6B0272; Thu, 25 Apr 2019 05:59:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by kanga.kvack.org (Postfix) with ESMTP id 5D7876B0270 for ; Thu, 25 Apr 2019 05:59:35 -0400 (EDT) Received: by mail-wm1-f69.google.com with SMTP id u19so3838283wmj.5 for ; Thu, 25 Apr 2019 02:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:message-id :user-agent:date:from:to:cc:subject:references:mime-version; bh=2k7lB3zYSqZ589filPfBZRV80I08rj+3gKaU91f/H30=; b=KynXkcsYLx6l/vACjoHkGe98r7SSW8Z8/DhiL338CKmK8Z/kGIKMn4tRIR0/VCx77w RlYdCsXzR7P+MVUNy0VnvJf0YL6OOZPD/ITrJAdENH7efLbwQIWUxEvqYgWVl4KGijXk Rp3m7TgbQjnJogBbu4EQbvD9nToH2+RViBSXmREbwTvG0qQu84clRjWpw9jcEyx4dqRo aCrStAmejzHzXC5N/uzqAeUsSpXyB4esVZTx1uFnqUIJra1DcBOq/14AIgc2tlhcJkpq Yn+oYIJxLOIZ06gvKPidUup6HPhQ3qIH+kNP0cs67OtOwNRtSsftl9qYogK6dsjAIe0A jfYg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de X-Gm-Message-State: APjAAAWDAIMx4hM6emHh13Ju9o89HUHrhzdDD679aqL57ZYmx9r+n1dI 4s/bmav9H+Ofan24zEN7ZCoorADI8PAU+DuRAQH4O0KmvX8pU+FE6azpSgOmkYFjBsoT1FhMxPM I8mpu/z9u4fnZnkaUFVrPpwXvkFBRrHtwPHt53WmapV8H7B4g67WX6htnq5r6sr7QiA== X-Received: by 2002:a05:6000:cc:: with SMTP id q12mr14285544wrx.251.1556186374933; Thu, 25 Apr 2019 02:59:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ4XTLAy0T42SZ7d20gu4KYdDN4rN7HKSYkltRw08iJ7iZSp3Y8EJVNCQdDGgATX61mhWg X-Received: by 2002:a05:6000:cc:: with SMTP id q12mr14285492wrx.251.1556186374107; Thu, 25 Apr 2019 02:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556186374; cv=none; d=google.com; s=arc-20160816; b=UOC+/JMi1qJSsH8NHpnz1EDioDLk86ZfbaOGnoMh1y8EiwRCDb7j7s9LcKCZ7zzPuw AsGq0ZGuTCqN0+oTCR9q4VO2TbfK4xnFtlGyhjNoujBsjrvnTF3Y+FiLfPu7ZJUFpIhQ 2fHHZQaplv3bD3Nuh8++kQJwSRk4wJqyevItq2W1Yj79HUzLpwUG1u99qeybonV80bLE Mm/36lN6915cHTU9SttWUy8Syt45Qh+64/2omjSAgwcsYIWaDam+ENbDz6Ht9XObDWjD aqFJ1sRicu4JlzRzRGNTSw+172kWUJ5peDl+Pli5auGfCSONRBNQ0otFvsjrZfV6+iLp v88g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:subject:cc:to:from:date:user-agent :message-id; bh=2k7lB3zYSqZ589filPfBZRV80I08rj+3gKaU91f/H30=; b=VJp7jHrw2ZuLhan+OuTXwNlE3zsFVFkjsSgUd/NfKD3Tpq0SG9FKSUaskDD8WMXked 7MVdldctptS5l41CFqBZe9P/k03seG7l4WBmHW+7xpYSfc0UWIXjYOZziO6x3A6OJF2y UovY4am8tE5c7MzaTGqwHaiJo13mVjUMoxpgES9C4p77B3IDdQmq7LuEKTxSiZjXTsHp BrBlyXGZYa0o95mZqtHWp1LIJoqNMU6jpS9zsfbEoUNEu5b5PBykhf1AkGGu9v0DyVN/ nS0aNuwGGq2/MJ4EJcxZHiCwfwlVyO+2B0bmuCfr+muQlxdtTxqvMNLcJLJnWmI0E7Ih QPEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id b144si1903237wmd.20.2019.04.25.02.59.33 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 25 Apr 2019 02:59:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) client-ip=2a01:7a0:2:106d:700::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hJbA8-0001us-4y; Thu, 25 Apr 2019 11:59:28 +0200 Message-Id: <20190425094802.803362058@linutronix.de> User-Agent: quilt/0.65 Date: Thu, 25 Apr 2019 11:45:11 +0200 From: Thomas Gleixner To: LKML Cc: Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , Alexey Dobriyan , Andrew Morton , Christoph Lameter , Pekka Enberg , linux-mm@kvack.org, David Rientjes , Catalin Marinas , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Mike Rapoport , Akinobu Mita , Christoph Hellwig , iommu@lists.linux-foundation.org, Robin Murphy , Marek Szyprowski , Johannes Thumshirn , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon , Daniel Vetter , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , dri-devel@lists.freedesktop.org, David Airlie , Jani Nikula , Rodrigo Vivi , Tom Zanussi , Miroslav Benes , linux-arch@vger.kernel.org Subject: [patch V3 18/29] lockdep: Remove save argument from check_prev_add() References: <20190425094453.875139013@linutronix.de> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP There is only one caller which hands in save_trace as function pointer. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- kernel/locking/lockdep.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2158,8 +2158,7 @@ check_deadlock(struct task_struct *curr, */ 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; @@ -2199,11 +2198,11 @@ check_prev_add(struct task_struct *curr, if (unlikely(!ret)) { if (!trace->entries) { /* - * If @save fails here, the printing might trigger - * a WARN but because of the !nr_entries it should - * not do bad things. + * 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); } return print_circular_bug(&this, target_entry, next, prev); } @@ -2253,7 +2252,7 @@ check_prev_add(struct task_struct *curr, return print_bfs_bug(ret); - if (!trace->entries && !save(trace)) + if (!trace->entries && !save_trace(trace)) return 0; /* @@ -2318,7 +2317,8 @@ check_prevs_add(struct task_struct *curr * 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;