From patchwork Thu Aug 17 07:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13356062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 734E9C2FC0E for ; Thu, 17 Aug 2023 07:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FdhZWOK/bRzL8Yvnm1/vAAme3a+xtNLdwDXb1g4Yfv8=; b=szu/OV7YeUz9bi 8X0Yp3BLATnu1ciY+aK+PODjvt59Jlt6Rq7ae9GJ9XTVv8qfkCXQx9olJXEyLZXrjaMW3RdQRn3KF 77JxOYjKeArXwjbFBSTLOv/M50la+BQTEDiebV+nGMy2PdIOolEUfY/gWZ1BlZPE+6AIayxNSMN6J nLW1+DMnJYvLLRyy6hdVtgNut6AlzGOrdYf1YZillcbbyOtvSAcs82jRSDdP3Xmr56pPwoW4ynGgF Ub9pUjQxD0MVxv27zjv3KBIl5rLjUyNiovPvC8PItI4eVTm9G9yvHajRwqd+99xVk2qCASFvvAqwR udiH6yr3jTrQ7tW8Skkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWXJ4-005iAF-0V; Thu, 17 Aug 2023 07:20:34 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWXIv-005i8U-3A for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2023 07:20:30 +0000 Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RRGX85C2sztRxZ; Thu, 17 Aug 2023 15:16:40 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 17 Aug 2023 15:20:17 +0800 From: Ruan Jinjie To: , , , , , , , , , , , , , , , CC: Subject: [PATCH net-next 1/2] net: microchip: sparx5: Use helper function IS_ERR_OR_NULL() Date: Thu, 17 Aug 2023 15:19:40 +0800 Message-ID: <20230817071941.346590-2-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817071941.346590-1-ruanjinjie@huawei.com> References: <20230817071941.346590-1-ruanjinjie@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230817_002026_289734_8452D83E X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use IS_ERR_OR_NULL() instead of open-coding it to simplify the code. Signed-off-by: Ruan Jinjie --- drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index 906299ad8425..bc1b4498ed04 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -1274,7 +1274,7 @@ static int sparx5_tc_free_rule_resources(struct net_device *ndev, int ret = 0; vrule = vcap_get_rule(vctrl, rule_id); - if (!vrule || IS_ERR(vrule)) + if (IS_ERR_OR_NULL(vrule)) return -EINVAL; sparx5_tc_free_psfp_resources(sparx5, vrule); From patchwork Thu Aug 17 07:19:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13356064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12B7FC2FC0E for ; Thu, 17 Aug 2023 07:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/j/tSsCMUsX8+HnPqtuYLKVhIhFdq8zmTDGMh6UECuM=; b=wfrRIzy1ncOR7t R13KlcDQ0IN+AeuyQiVa1D2NOYCvHV6795rwXuREKdMy4qXeyFwuLaoG3s2OWY2c7inu6XsAKgXfJ ebxnurMdj8LgDNCq6VSiDQk2wr93a4XUDJRHvLda3jG7fptfjCKfokr8JLdGPO/JqaECciHVHMTVZ ewxWJ79cNxAWhwDqU1I4X2rSLmJN+CXYDaChWDCm9/T5SQGP133Wf0E+sub2YimgHyXr4VMCNspOy OCSrsbl96duiWJSjQOYKw1NCxNA2qf2z9aZ/IaN8I9Zm3D/qCPU5uGYsLjtxcbpA6Z1PIVLzCSsjB L6jiZSLnfUapI1aVeegA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWXJ3-005iA1-2C; Thu, 17 Aug 2023 07:20:33 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWXIv-005i8V-3A for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2023 07:20:30 +0000 Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RRGXB0HVMztSLZ; Thu, 17 Aug 2023 15:16:42 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 17 Aug 2023 15:20:19 +0800 From: Ruan Jinjie To: , , , , , , , , , , , , , , CC: Subject: [PATCH net-next 2/2] net: stmmac: Use helper function IS_ERR_OR_NULL() Date: Thu, 17 Aug 2023 15:19:41 +0800 Message-ID: <20230817071941.346590-3-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817071941.346590-1-ruanjinjie@huawei.com> References: <20230817071941.346590-1-ruanjinjie@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230817_002026_292150_86C6F025 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use IS_ERR_OR_NULL() instead of open-coding it to simplify the code. Signed-off-by: Ruan Jinjie --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 733b5e900817..fe2452a70d23 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1165,7 +1165,7 @@ static int stmmac_init_phy(struct net_device *dev) /* Some DT bindings do not set-up the PHY handle. Let's try to * manually parse it */ - if (!phy_fwnode || IS_ERR(phy_fwnode)) { + if (IS_ERR_OR_NULL(phy_fwnode)) { int addr = priv->plat->phy_addr; struct phy_device *phydev;