Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2989391imm; Mon, 13 Aug 2018 04:12:31 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy7/e3AVtAZ8NA7sJ23yLkZLJP6t2Ee28QllyxIE9hzNknL8aAdZC5iY4VDexeT/cqIF7Os X-Received: by 2002:a63:ae42:: with SMTP id e2-v6mr14020631pgp.351.1534158751001; Mon, 13 Aug 2018 04:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534158750; cv=none; d=google.com; s=arc-20160816; b=tbJtZOsIXViEhkrvIqHQJUmijwQqvw11zslKJMIyTsL6XRwKuiQl6LXFjwwIPvm0cF K+4yqAdT9y+GFpxE0AHf99gTRInkNDt9WHAqVdKeboS2yWTBSzZJOAYWuOhBCU/VcyG+ Cb0bMOl4SA+nM3e/UYwgbgK753FdUxTnIodytlqb9lAGclbZf3tU7ZVhY9yKrHz27kt/ W7EkCpp87f8UNilFXfd87igQHkG95VJ3Pn3JKNAEH1aYAw6DBmXz+hiWQaVOGGnxLPeQ RMqhvuIcs6eYoUHRtuVTg0X1MT/H5KYIqK7uvZsNvTlkVqtJaDWjoW25RPF0qsW3izI/ 9EWw== 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:arc-authentication-results; bh=uNDh9GxTC2ry4WZH5ub+EjNwrrWV9zKu56odLL4mYmE=; b=bL2iWFAFrBG6GrSGgu+L1Mi8/RjKWV+i+CxIpAIgHIcCc6zMNhjdan5NJommnU0SGW hT6Bz4iOulINo0lcCOfG/Sy7cO9/w66W7kEUl22KNoEJUIDRGmOQuZBmc3eQ71+D+Rpg OViDLWY2THOWjltUpDX/iJOKjMDVEqbPTArLi1DqCN2cQVQnV+ZnX1uu5yA8SqlMh6VB pvWBQScpOpSUHm6U3oYvRezW6Wqwma5B4y8jf1qoCpBU0LkikhwORXOjtvVpMQRlrKpU G2HUcM6Zyu6X5T0FzxrUtpIRUj9rG6yKPAu7eAecJazQCuLGlL+2U3Hpz+5ecp/DAtke uD4A== 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 d127-v6si19568542pfa.189.2018.08.13.04.11.40; Mon, 13 Aug 2018 04:12:30 -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 S1729250AbeHMNsl (ORCPT + 99 others); Mon, 13 Aug 2018 09:48:41 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10712 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728402AbeHMNsl (ORCPT ); Mon, 13 Aug 2018 09:48:41 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 962ED5D8FEC57; Mon, 13 Aug 2018 19:06:49 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.399.0; Mon, 13 Aug 2018 19:06:46 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the open code Date: Mon, 13 Aug 2018 18:54:59 +0800 Message-ID: <1534157699-23637-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 has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index a49e279..9a8ff1d 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -403,10 +403,8 @@ static int mt7621_pcie_parse_dt(struct mt7621_pcie *pcie) } pcie->base = devm_ioremap_resource(dev, ®s); - if (IS_ERR(pcie->base)) - return PTR_ERR(pcie->base); - return 0; + return PTR_ERR_OR_ZERO(pcie->base); } static int mt7621_pcie_request_resources(struct mt7621_pcie *pcie, -- 1.7.12.4