Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1577572ybe; Tue, 3 Sep 2019 00:01:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqCfu7io+uTSnwG3ctynx8kdQu38RWQ1sW6mpx3G4uXU7HGzbvO8vwDCjnpWo8tqbMdyz/ X-Received: by 2002:a63:fa11:: with SMTP id y17mr28932870pgh.267.1567494094786; Tue, 03 Sep 2019 00:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567494094; cv=none; d=google.com; s=arc-20160816; b=W101Ami5EXueiaN/ZrBnn7Xjkt3YYH0qIdFFDTiBttNqjTcDm3AhzMN8i7431ftRJn V+ysWUYiRFBeIKW3vX5PoNt1w60cEyrO6jblylzJQ/qGDpfB+AKUWHMBlD+Snc5BabU7 XPtQlWde1uGQE/CN3ItM8nX299ZctsctCqmcP/LrPubaFxfF4SejtccIaNql4b/Nz2wV ZBR5aTgMDnSz0Bu1fFnmYhrqTf6o7zt1VjGBEJApB1VaFSUeuIXz1wZ9VJOUsxWkiPds Zwsohg99VCDprmFWJoipQOi2ZiSFdDW9/oAJ+45Da8wZKonQht3qZy5rlZX7sy/l7rtz Q+mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Km6KX45pjtTbQDhQ6YGYwBADvsucAtOHOiM+C3tHsxs=; b=OJLFW7xoFlonFYBhEqBu5T7vhfuFpJKhN7+Y+ZhvcKSWTdd9a2Efm9pMpzWKUo6ZfZ 2l5mi0Tr1vDZnIZ2J3cbzn3ZCUFTBMKyyd7UnYQMUV/NfVr5q/F0YVTVtdojinSIwhfS hLZybXODZvtspVqVmldhdXgTKOnKBIiusaTDR+SACAOsOC3tbgKFedtmbSsM1SKHKxtc q5ADWcxhZZoJG7n0sXRrT5cxZqx9DajrEpbTjnJtq/I/KufqnWNg0dFYRA6Nr2DAxjcM U+rY+Qn6cqryKK546RVmLQkx1C/aTyCQpdhIwOw41oIljs5P8Vo+ShPVBFUXgkr1RiSk BYYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u69si10618602pgc.298.2019.09.03.00.01.19; Tue, 03 Sep 2019 00:01:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbfICG7P (ORCPT + 99 others); Tue, 3 Sep 2019 02:59:15 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5725 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726473AbfICG7M (ORCPT ); Tue, 3 Sep 2019 02:59:12 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B030542BB1209F07EE3E; Tue, 3 Sep 2019 14:59:10 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Sep 2019 14:59:04 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH] net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation Date: Tue, 3 Sep 2019 14:56:10 +0800 Message-ID: <1567493770-20074-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 5581a80..2e0b467 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -989,10 +989,7 @@ static void mlx5e_hairpin_flow_del(struct mlx5e_priv *priv, &flow_act, dest, dest_ix); mutex_unlock(&priv->fs.tc.t_lock); - if (IS_ERR(flow->rule[0])) - return PTR_ERR(flow->rule[0]); - - return 0; + return PTR_ERR_OR_ZERO(flow->rule[0]); } static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv, -- 1.7.12.4