Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3010886imm; Mon, 13 Aug 2018 04:35:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzWpEtuXHLTY8ifVvhfffYiMeugce4hamq0Wef2EByYAnCpbRap2KKTWRFXZH6zdRY9oISn X-Received: by 2002:a63:f18:: with SMTP id e24-v6mr16872355pgl.320.1534160148564; Mon, 13 Aug 2018 04:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534160148; cv=none; d=google.com; s=arc-20160816; b=aOvFc/R1Q5ssXH1weiP67gwP56z2OlyhcX36uqTOxBKFbYGXzHFNhoSVsB6PHN/lw0 jIyjaluBtxwC14lRrRNkZtXTyWTzpze8WiyIWPAYAaRv0fxeGrD2tqj0Fkg25WX/VGyR 7qtFE3aJfTHPLca63QeS77mfTi0fcmq0qKJDwWdaSUy5sflwga+OmTg4fz6dkRyeDJAe xQxv+KRMNS9pVyV/C4qsls+x9THB3cpG4I+FTNolu85VD4WiCBTDbhezxdtFNvRt4/ps NnfFyQC+a0HoemmIKYWqhbMWR/MljT+6ZYciFGxbEj+X0LRRFcu52JnkZ0Z0KhMly2c9 U4dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=NLAPbSRz5GtA3Ffb54Ff/8/WjZMYcknihCS7GNBc5ek=; b=nlf99CfIBoUbTq/OcJXOSK+DIEqtRQMN633QtwfgWBnJkf2A7P4qGxz4QnRJmC8IBJ yvb1X3+0fFQd9dh39UAODW26MymipdvJFiJ03XdVUctx4kuf8w1VUrBad3Jtsa0fbmei 8752gvn0eN6E75ZFFA0lNr3AtskmEI6dMRSh+WpHDKkmbNo/2ROu4Zeq8cmMlS6K1Qt7 iGB3FWAF4jFu2xByqQcW7Luea/DfA8DznPVcyS3LLSjRb0Rt+piUS8CFMY+WwdK0yzPx xEW8u/w7QsElRpISjUjBxeKUXGkaR3dZzu1MyMcwPjBDkpVZxU2pkgPC9Jrh+3Dzjl8f v6Lw== 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 bc3-v6si11604856plb.214.2018.08.13.04.35.32; Mon, 13 Aug 2018 04:35:48 -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 S1729313AbeHMOPQ (ORCPT + 99 others); Mon, 13 Aug 2018 10:15:16 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42052 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728661AbeHMOPO (ORCPT ); Mon, 13 Aug 2018 10:15:14 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 971494346645B; Mon, 13 Aug 2018 19:33:18 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Mon, 13 Aug 2018 19:33:15 +0800 Message-ID: <5B716C79.8060809@huawei.com> Date: Mon, 13 Aug 2018 19:33:13 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Sergio Paracuellos CC: Greg KH , NeilBrown , , , linux-kernel Subject: Re: [PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the open code References: <1534157699-23637-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/8/13 19:26, Sergio Paracuellos wrote: > On Mon, Aug 13, 2018 at 12:54 PM, zhong jiang wrote: >> 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); >> } > Hi Zhong, > > Thanks for this. This driver is in the middle of cleanup and this > function is not doing all the DT parse > yet, so this patch looks good but after applying this series (if they > work and are good enough to be applied) > has no sense. > > See: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-August/124890.html > > Best regards, > Sergio Paracuellos Thank you for let me know that. Sincerely, zhong jiang >> static int mt7621_pcie_request_resources(struct mt7621_pcie *pcie, >> -- >> 1.7.12.4 >> > . >