Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp157311lqg; Wed, 10 Apr 2024 20:28:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfRaDO/Ulp5ioV7ge2sfFidpZmFdflI6AmWOKrwfchkEYllPR+qYArFMFmunAk3pFsXzsDpKB1MvsQNVlmNatU7Fwd6TfkQH6qUpH2rQ== X-Google-Smtp-Source: AGHT+IGszKwpPTjlt+Yt2t4FEsBJpGX6tAtUPufJfjegVx0FfGQXxVJUTGax+24Q17XonSCa1C3s X-Received: by 2002:a17:907:9725:b0:a4e:21e0:2e6e with SMTP id jg37-20020a170907972500b00a4e21e02e6emr2979523ejc.5.1712806128828; Wed, 10 Apr 2024 20:28:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712806128; cv=pass; d=google.com; s=arc-20160816; b=MlNx7dTotNWYgtUYNhUCYe55Wim7iSAIy+IL+psdwaleYZjGQMq2tXOa/GgorPJHz3 9fvAfMybPPBvaro5ATpNa1cbM5T4VQOR83a9RWO3/9xsKxpBn04ae2Qr+SQb7U6475oU uzKu/Z0XUlSIJ3HcTZgZouGSuMMqOXXVCFRI2/uinVDbnzDL93wFKM24TRirjPiKbb1q ysyLCGMmEYhIJSkFXu8bCjtepuHMeV8L149pu5Ck8xFp3eHpnYdKpEpyMyvfv5QDSJne jEu8Md4ZWrFcX2zLIJfXEp6w6lifC1onDiLx45aztHb05MnlUbur4Md1CN7rKHwFBpDX W06Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=g/GWutMK4UGkDvhv6zTqKAc4pOyyADX1q0OKt9hY7Wk=; fh=+dJ7b60PYqnRfKS4jvI8ryeEru0AA22XUsytD6azWIk=; b=UQX3BBEQvVQSlJ0/YItZJ2VJtJi4nB9S3SWBYW0+ytbeLvC2ymDq0iidX1JHg7qAKg 8vgAYFSMMfGrAsxZvgDC3Y+97goNQoLiU3K2UWeU0rHu4M8KzO+ePo0tiBGAteclQutu h9p6NGRfMjKVRB7pylOdGtWPR19kT5zSpIILaUEtN91ZXr+YX9CwST76jxIBpfd8+KHg 78P1+lcXXo/QgdcRfrUfq3e9aHaO7bHwDIxrOknnZFVLv9lXO5ZVLDSDcU18tM9snPWm KwDmmo4PAuNIOfQ3QmPnrC1UFRdxLJkne1R1zVKfC61PWYfBBG+lpgJ0qpt633WF1MJt obHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ds22-20020a170907725600b00a518fdbdcf1si318419ejc.521.2024.04.10.20.28.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 20:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 33FE11F23960 for ; Thu, 11 Apr 2024 03:28:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4351B13BC1E; Thu, 11 Apr 2024 03:27:40 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ABFC13B7BC for ; Thu, 11 Apr 2024 03:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712806059; cv=none; b=i57b1P07soo8kWAyC+hzDFNK0ARxvOkf2CkCvINPlXLhJ5828J2rzuqEBc6hG4A+A9JTLlO0YUFdbcvqAkIrlx4ArAHVQ6X0eSrPJNGra0bMyQ8AEVACsp1IGjur2b0/TGA9lZmDfmoPnt5fHTVnaqgFOMj0pVdueiQ80jQb/1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712806059; c=relaxed/simple; bh=MYfEYFO5p+lVlBUiv067qCyD2JDgfl3EUV51g9scmeo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bOMfWMmC5X5Lr9h8a1uV/7pwJAHOPwkU9B0u4goRjOOdzKOszipvT+a80US7a9Kjm1sB++4A5o8gaZ8leZ8pDs2QZRaRfK5SJ1hsE4uogXbeY0MZh9GYLuyTpVxx2LLlxt7bqYfO0UZrfSb9cuVtQf0h1P9dir9+M5MlOiNP6Wc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VFQ6f5T02z2NW6b; Thu, 11 Apr 2024 11:24:42 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 1698B1400D9; Thu, 11 Apr 2024 11:27:35 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 11 Apr 2024 11:27:34 +0800 From: Zhihao Cheng To: , , , CC: , Subject: [PATCH v2 4/4] ubi: debugfs: Replace IS_ERR_OR_NULL with IS_ERR in error checking path Date: Thu, 11 Apr 2024 11:19:03 +0800 Message-ID: <20240411031903.3050278-5-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240411031903.3050278-1-chengzhihao1@huawei.com> References: <20240411031903.3050278-1-chengzhihao1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600013.china.huawei.com (7.193.23.68) Function debugfs_create_dir will return error pointer rather than NULL if it fails, replace IS_ERR_OR_NULL with IS_ERR just like other places (eg. fault_create_debugfs_attr). Signed-off-by: Zhihao Cheng --- drivers/mtd/ubi/debug.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index 989744eb85a5..3bcdf4e70a0a 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c @@ -248,11 +248,9 @@ static void dfs_create_fault_entry(struct dentry *parent) struct dentry *dir; dir = debugfs_create_dir("fault_inject", parent); - if (IS_ERR_OR_NULL(dir)) { - int err = dir ? PTR_ERR(dir) : -ENODEV; - + if (IS_ERR(dir)) { pr_warn("UBI error: cannot create \"fault_inject\" debugfs directory, error %d\n", - err); + (int)PTR_ERR(dir)); return; } @@ -299,11 +297,9 @@ void ubi_debugfs_init(void) return; dfs_rootdir = debugfs_create_dir("ubi", NULL); - if (IS_ERR_OR_NULL(dfs_rootdir)) { - int err = dfs_rootdir ? PTR_ERR(dfs_rootdir) : -ENODEV; - + if (IS_ERR(dfs_rootdir)) { pr_warn("UBI error: cannot create \"ubi\" debugfs directory, error %d\n", - err); + (int)PTR_ERR(dfs_rootdir)); return; } -- 2.39.2