Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1589165ybj; Wed, 6 May 2020 01:15:26 -0700 (PDT) X-Google-Smtp-Source: APiQypK2e5TVKA963Q16rezzRI4IWA+cJaGX1df/pU6PjiazEOSkAOgkO2GcuRCQPoOc2asIGHgM X-Received: by 2002:a17:906:3709:: with SMTP id d9mr6479593ejc.94.1588752926283; Wed, 06 May 2020 01:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588752926; cv=none; d=google.com; s=arc-20160816; b=UwFSRyPESBY2J9aHTfto3ePjZRDgqUMuqAFctJwBhEibN00GrGQ80sB+kC/cnv/N1i 62jh/V3estDm779/9zlsiR/S2vdCePZtnQd5phf5oXfDxqfRnE7qx/L1tSWg7HTyQRF8 esgZzGQO9HMffUyP9fYT71cCgK2LjT8Ifq1sXWUYDRz43jaGVAh+Qozkzb+W+i60a13K DjA1n2lnjYbAiO6azjZBCTsrjkEts5z/zaAzel/kpPcm7a0sM10KKZ+7vQrUvYWZBOHn t1+mcLfLTm1R9LDn5q25e7N7+Rz+Ql5UDMMODZ69Mi+cehDFpUY3akSIe8epFWrgiDOc pxJA== 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=Crx0KKHrZ45QzCxELwooiUiFJ931qGawejhTGR9J1oI=; b=lj+Ivyp2qtowujY8RLm3knRyJXpaGVVDRTGp3gEyLH4H04ZZCqij9tlOd5GKjteLCe QgRXXmCmnYYrL9BbylRo5BTHTeeUGu7gzJw1Cj8c7YGNG1GHCkWg4IB3x0G0wmpuy1jD ywOFb83DOldAZqAWjBpzqGa/5DDiJGUfBFCBIjFBcLkoka2Ra/fnBtAMxyYTW9/AavRI pvtJRTFc3NioaZJqhtrI+JTN4IO8BDcPuJEA1imirNrgSfl+pRsVdFwpht7XiW4r1gm4 pSoFiUVMlyO8zc18rxMKt2b53uOqv1ApNOoTdBlGEhOMXI/r63ify5CgXiy6xGl3ovFO +5Iw== 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 g18si604097edj.259.2020.05.06.01.15.03; Wed, 06 May 2020 01:15:26 -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 S1728371AbgEFINh (ORCPT + 99 others); Wed, 6 May 2020 04:13:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3815 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728296AbgEFINh (ORCPT ); Wed, 6 May 2020 04:13:37 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 04979B12EBCE9B3C3C94; Wed, 6 May 2020 16:13:35 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 16:13:27 +0800 From: Samuel Zou To: CC: , Samuel Zou Subject: [PATCH -next] nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code Date: Wed, 6 May 2020 16:19:37 +0800 Message-ID: <1588753177-37750-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/nvmem/jz4780-efuse.c:214:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/nvmem/jz4780-efuse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvmem/jz4780-efuse.c b/drivers/nvmem/jz4780-efuse.c index 512e187..0b01b84 100644 --- a/drivers/nvmem/jz4780-efuse.c +++ b/drivers/nvmem/jz4780-efuse.c @@ -211,10 +211,8 @@ static int jz4780_efuse_probe(struct platform_device *pdev) cfg.priv = efuse; nvmem = devm_nvmem_register(dev, &cfg); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); - return 0; + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id jz4780_efuse_match[] = { -- 2.6.2