Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1388803ybj; Tue, 5 May 2020 19:51:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKzf+6LsM4MQ6RhkTBQlQz0JaWzySmIntYF9IjvEmXil0rQhYpk43KhhUvGDLTEpny1WQYK X-Received: by 2002:a17:906:6d90:: with SMTP id h16mr5343832ejt.117.1588733479449; Tue, 05 May 2020 19:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588733479; cv=none; d=google.com; s=arc-20160816; b=h9kVKVQL0KSSYzNF0zyULggIzOPauprgMUTEBBo88fKmDkDEG/Ca6flBoR0CXMT9Cv jlYhDJt6DIB0d2LrEZcaa13qplHao/3jRZRG7dUIl8zFz6USUVOiQ64mjUtqPiJg3AQ9 aJM8RYKUinAxipc0vlGvyX8VxGQuvynFZmHciKamBpcl1rL61sNwkCMu9o8V2BtKo418 X9cPrpKta/xWwLhDO/A2O+4vkq619IZ40t3ccSsogEjUT2wPz4AcKjVf17cF4rYUm9oA rcNKIrxK/RaupO1ZsRCz1NRj8ysFGlK/puVlKO+qdbbMekIyT3fBCbXIjJmaMv6EX2x6 obXg== 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=c4o/I8F7Mo9EBoGS2HN9esf/r73GT0UCil30wrHwIHk=; b=dvM0ShMdodWt+m+KPLpOspKIK3QLdhAeAA65WP/7Qm7o/cSOmV7UFW1P9/EkyeiYyu 2qoCA99j5nxTf7b213t6AgnwD8me2SCvz70JSgpP1/sGZB5ZPgWCNu6gPoQtklrQ1/l+ 4G2KgoUdqtz3U/8+4NGVD7msb95f+J9JDCYLvCVq7P3RnvPvvPY794wuw50t4F1EEXfr gy12mEuE1TuddQzp2z4Uh1CMpggW1lXGhlgergHcwCTXMJzMdtD8CxsAKxvldX7VwL3H xLr122EeCE2y1+ZRA83nrxZZY1dk0GVWp+KHeTOe1qgo0YD91BOwq/QR9+n90gRlOuzZ YF9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh17si301917ejb.10.2020.05.05.19.50.56; Tue, 05 May 2020 19:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbgEFCtD (ORCPT + 99 others); Tue, 5 May 2020 22:49:03 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:47376 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725966AbgEFCtC (ORCPT ); Tue, 5 May 2020 22:49:02 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8175C1F0BC7A8D842B63; Wed, 6 May 2020 10:48:58 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 10:48:49 +0800 From: Samuel Zou To: CC: , , , Samuel Zou Subject: [PATCH -next] net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code Date: Wed, 6 May 2020 10:54:58 +0800 Message-ID: <1588733698-33746-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes coccicheck warning: drivers/net/ethernet/ti/am65-cpts.c:1017:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/net/ethernet/ti/am65-cpts.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c index 370162c..51c94b2 100644 --- a/drivers/net/ethernet/ti/am65-cpts.c +++ b/drivers/net/ethernet/ti/am65-cpts.c @@ -1014,10 +1014,7 @@ static int am65_cpts_probe(struct platform_device *pdev) return PTR_ERR(base); cpts = am65_cpts_create(dev, base, node); - if (IS_ERR(cpts)) - return PTR_ERR(cpts); - - return 0; + return PTR_ERR_OR_ZERO(cpts); } static const struct of_device_id am65_cpts_of_match[] = { -- 2.6.2