From patchwork Tue Oct 3 08:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 147754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1937655vqb; Tue, 3 Oct 2023 01:31:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWKQMJihQAZbBkDzXCzDLNYw0+aec5RUPI/LEFqJLNLEiPaeOp8I7XGKRhX6dhD8/319bL X-Received: by 2002:a05:6830:a57:b0:6b9:2869:bd81 with SMTP id g23-20020a0568300a5700b006b92869bd81mr15281046otu.18.1696321909907; Tue, 03 Oct 2023 01:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696321909; cv=none; d=google.com; s=arc-20160816; b=xZxYZzyi+l7CFx3gGuh4x7GYkJlaDCtYsDLHQV9wE0hMndasBI3bSIuxllMca7BZRT EA2rQGHldhl0okB94FKs38FfE235rF2HVssV4dcyqNKFsLennJhHfKMEya9HgOJSeT7E xj+BE0dJEXyXqG7aa7jJNECR224VarCO3wxk8IvAB7qQjUdt4lryUlnLuiNVdRMZ3mYb QjS42VjQPMwkUIzlJlgmIRKYPXmoM2QtCDIgCsgnDL6hLaR5Vi566KT7tHD3qiXLRPv9 jMwRmXi0F4c0WzpOz+JCGQTZzJKK19O8dfzSAI8cqAUEcyVqNY9LmFSw8eJGei+hU0iv 0+Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=DuTf4zBzupu3tS5EJOcDKJ82yoQ1Iej1IAmwDpUABmg=; fh=9VyHsCpykqKMOeDTpn8Eq9gAJXVW9lPhjiNt85q1nmk=; b=fAivBO50W6q7kHHl0UJRtAs83P0nx8+1WkkFkYzTlD817Gha2sI1xkvdS7vqz7Si4W lluUTwhyNm10qobBmxSOODjgU+ZiPvMBuMTt9gTltQGlTFjTWgKUIYltW9s1GFKPi4vp JxJ4vVkbsu6oM/qNGPdpOdnkNN/2OmZEJlfspJnKE5kfPqOqz2AHdiageINdvAJ2StMY 7TTvhwgJzhAnq0CJo71s3dlobrJPlzv9RPNx4Ox0/hgE9L97DywlUGROCoGK2ML9ZtO6 zysS6WUuuPKukZ/kumQ0+jjYN2Zh098lL+HE6PCrAqsCvE3xjv9ObsodS/9eyzLnTWpZ lgAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wrwrzpsZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jjalq+DW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b00565eedb1cf8si1066864pgu.825.2023.10.03.01.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 01:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wrwrzpsZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jjalq+DW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 05DBC807EA39; Tue, 3 Oct 2023 01:31:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239295AbjJCIbk (ORCPT + 18 others); Tue, 3 Oct 2023 04:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239188AbjJCIbg (ORCPT ); Tue, 3 Oct 2023 04:31:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0384A3; Tue, 3 Oct 2023 01:31:17 -0700 (PDT) Date: Tue, 03 Oct 2023 08:31:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696321876; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DuTf4zBzupu3tS5EJOcDKJ82yoQ1Iej1IAmwDpUABmg=; b=wrwrzpsZKEqYpRdzSVhQidSUl3Jetb3IEbEMYmxzYeFRhJQFBd2gyHsoxrZg7cmLAWJ4PT ScsZzByrWBkOVD/CPx8c74ip0WGhyQoZUdx+T6vJzVkpQy5dRO7f8FkwiOHmm8Ka7Al2yF hgHqAqbC9IYH9izDhYiCh1UZlJyK8Oo68ouKLG39tEMO7BFps5f33igKO2Kl0NdOVj7tl7 UpxVZC4L0/D+5kcsNm3oOsD7PHNxCG8I7R85FaSv/nmIVFCfldBFhlk9t1gwI2lQk6tNK+ AjW84G2/bzoUA6CNsCc6En9k3sYa8MkpHEFdv0quDQEvb/ocKTVDi9oyZZvJ3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696321876; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DuTf4zBzupu3tS5EJOcDKJ82yoQ1Iej1IAmwDpUABmg=; b=jjalq+DWKAVGnFvffD8pGgDRGJQOQKpkj4LifgvVKSVn3t9j2b0Z5ZDgr7G0ciXNHR4EyJ GuejQ9T93BG4pVBA== From: "tip-bot2 for Atul Kumar Pant" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] locking/debug: Fix debugfs API return value checks to use IS_ERR() Cc: Atul Kumar Pant , Ingo Molnar , Waiman Long , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230807121834.7438-1-atulpant.linux@gmail.com> References: <20230807121834.7438-1-atulpant.linux@gmail.com> MIME-Version: 1.0 Message-ID: <169632187534.3135.6452660777810427626.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 01:31:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778722443002286027 X-GMAIL-MSGID: 1778722443002286027 The following commit has been merged into the locking/core branch of tip: Commit-ID: 8788c6c2feb3600ba1a2f84ac5d258af4a284cea Gitweb: https://git.kernel.org/tip/8788c6c2feb3600ba1a2f84ac5d258af4a284cea Author: Atul Kumar Pant AuthorDate: Mon, 07 Aug 2023 17:48:34 +05:30 Committer: Ingo Molnar CommitterDate: Tue, 03 Oct 2023 10:11:25 +02:00 locking/debug: Fix debugfs API return value checks to use IS_ERR() Update the checking of return values from debugfs_create_file() and debugfs_create_dir() to use IS_ERR(). Signed-off-by: Atul Kumar Pant Signed-off-by: Ingo Molnar Acked-by: Waiman Long Link: https://lore.kernel.org/r/20230807121834.7438-1-atulpant.linux@gmail.com --- kernel/locking/lock_events.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/locking/lock_events.c b/kernel/locking/lock_events.c index fa2c2f9..e68d820 100644 --- a/kernel/locking/lock_events.c +++ b/kernel/locking/lock_events.c @@ -146,7 +146,7 @@ static int __init init_lockevent_counts(void) struct dentry *d_counts = debugfs_create_dir(LOCK_EVENTS_DIR, NULL); int i; - if (!d_counts) + if (IS_ERR(d_counts)) goto out; /* @@ -159,14 +159,14 @@ static int __init init_lockevent_counts(void) for (i = 0; i < lockevent_num; i++) { if (skip_lockevent(lockevent_names[i])) continue; - if (!debugfs_create_file(lockevent_names[i], 0400, d_counts, - (void *)(long)i, &fops_lockevent)) + if (IS_ERR(debugfs_create_file(lockevent_names[i], 0400, d_counts, + (void *)(long)i, &fops_lockevent))) goto fail_undo; } - if (!debugfs_create_file(lockevent_names[LOCKEVENT_reset_cnts], 0200, + if (IS_ERR(debugfs_create_file(lockevent_names[LOCKEVENT_reset_cnts], 0200, d_counts, (void *)(long)LOCKEVENT_reset_cnts, - &fops_lockevent)) + &fops_lockevent))) goto fail_undo; return 0;