From patchwork Tue Feb 2 06:54:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12060861 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 292C2C433E0 for ; Tue, 2 Feb 2021 06:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E53AC64EDF for ; Tue, 2 Feb 2021 06:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbhBBG6W (ORCPT ); Tue, 2 Feb 2021 01:58:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:50154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232292AbhBBG4f (ORCPT ); Tue, 2 Feb 2021 01:56:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CCCCE64EF1; Tue, 2 Feb 2021 06:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612248923; bh=L15FatajAyy3rvAPGIPPQz372ewQ6y+1gWvpCt84AmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DuJ7Ksk+KlIP6nzFdi79SKWnD+QHhRHuHuHqCVIPE/Qys8mJ5r5ehwmY0SahuaUdz ig78229EnhdcLEqigBe3nYeeT0hLfE5pvcJOMHpSqkcH/hv/azzHtLfsjNqbeMqPaG cGtU9EM7aRKb//LnpTYz5ceMjHdzOVtHbWi2wDvQQrHhABoGDCvgIko+siJCHAxz2K KFAMIXHBl6cinZygHSv7dt6sl3Rv8FdjbYOZYQDVztHLnK5B/NapEUNE/RGzyJ56q7 ET7NKYnfcuV+wL3omcMQu9hek7gJRiAPmB6xOD+gSIqIYTC+QdboYjAuxuMOg0u1xq eZuIDIxPuZesg== From: Saeed Mahameed To: Jakub Kicinski Cc: "David S. Miller" , netdev@vger.kernel.org, Saeed Mahameed Subject: [net-next 13/14] net/mlx5e: CT: remove useless conversion to PTR_ERR then ERR_PTR Date: Mon, 1 Feb 2021 22:54:56 -0800 Message-Id: <20210202065457.613312-14-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202065457.613312-1-saeed@kernel.org> References: <20210202065457.613312-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Saeed Mahameed Just return the ptr directly. Reported-by: Jakub Kicinski Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index e417904ae17f..40aaa105b2fc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -770,7 +770,6 @@ mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_counter *shared_counter; struct mlx5_ct_entry *rev_entry; __be16 tmp_port; - int ret; /* get the reversed tuple */ tmp_port = rev_tuple.port.src; @@ -804,10 +803,8 @@ mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv, mutex_unlock(&ct_priv->shared_counter_lock); shared_counter = mlx5_tc_ct_counter_create(ct_priv); - if (IS_ERR(shared_counter)) { - ret = PTR_ERR(shared_counter); - return ERR_PTR(ret); - } + if (IS_ERR(shared_counter)) + return shared_counter; shared_counter->is_shared = true; refcount_set(&shared_counter->refcount, 1);