From patchwork Wed Aug 2 09:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 13337921 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 81CA7C001DE for ; Wed, 2 Aug 2023 09:32:59 +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: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:In-Reply-To:References: List-Owner; bh=hS/HaTxa9+cRTNSLbb+uatXhbF8kTtVi/xVn6NrTBds=; b=FXIEhVDBoh9qXz ZFJMzIHVByZlsGTVSpUxo3Zpe2wpkMS5XT68850FvHVSqoe5VP0lnabVP3K0PvswQibZSlkFbatnX zbelJdE8WOTSEXGr8BaktxvIbisf0+OAkyeZoyoZcMZm+j3iPr0p2sVO69TUHS1mrR9/ZU7Gl/6cp TXNEzbWURKtKOYKh6gCB2ouSpNfdVE5bFoD1MjlnBV7/lck6Lq1urXVfl4TJaGAHYiMmBwSU2eyLw pP8WqwokrWKswdUG+baIM8X954Pj1NB5jzbCxom4rpex4x+nbU5M1ezKVs01mg822JGgmVH4OzHxS nff92izBvgOBdSlE7GJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR8DZ-004UHa-1y; Wed, 02 Aug 2023 09:32: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 1qR8DW-004UFq-0L for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2023 09:32:32 +0000 Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RG6DW5NQXzrS1M; Wed, 2 Aug 2023 17:31:23 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 17:32:25 +0800 From: Li Zetao To: , , , , , , , CC: , , Subject: [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule() Date: Wed, 2 Aug 2023 17:31:56 +0800 Message-ID: <20230802093156.975743-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230802_023230_318735_CBEB0433 X-CRM114-Status: GOOD ( 10.38 ) 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 There is a warning reported by coccinelle: ./drivers/net/ethernet/microchip/vcap/vcap_api.c:2399:9-16: WARNING: ERR_CAST can be used with ri Use ERR_CAST instead of ERR_PTR + PTR_ERR to simplify the conversion process. Signed-off-by: Li Zetao Reviewed-by: Simon Horman --- drivers/net/ethernet/microchip/vcap/vcap_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index a418ad8e8770..a7b43f99bc80 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -2396,7 +2396,7 @@ struct vcap_rule *vcap_decode_rule(struct vcap_rule_internal *elem) ri = vcap_dup_rule(elem, elem->state == VCAP_RS_DISABLED); if (IS_ERR(ri)) - return ERR_PTR(PTR_ERR(ri)); + return ERR_CAST(ri); if (ri->state == VCAP_RS_DISABLED) goto out;