Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3003119imm; Mon, 13 Aug 2018 04:27:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzp/hwGb47JBJtv9umeeUx/xK309RkQ9GR1paX+lyDO+XRDzy5K1ANeLCgUMtMhLC56n1Oi X-Received: by 2002:a62:229a:: with SMTP id p26-v6mr18660171pfj.53.1534159655326; Mon, 13 Aug 2018 04:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534159655; cv=none; d=google.com; s=arc-20160816; b=z5MCTkE4f9DULfn0OUI0x9GxTlQjxksRDRwo4YxicWEhEPWEv8DNVF4mjluL4jPiUQ 8JI0a08x0KAfcM31gb7uCOkJ0yKB04U4hAj0PxbYvgr5cs9sfg/v8WaTi7DSfaPQH0L/ 7gUj7QQMTaAZeLQ4TqDN3PoOQpe8v9nyk71O0K0fBdnO422kqR+Hypb5b3PpUxgTmL3F rzQ/8mzwsETe6221sU5JarRsCGgEMC/ge4sJ/ZTapuqIeeHdfLck+0LpBP+Otx3j6DGS UWXOkHpYE/8hN6wuXXJH1023tYka9frDiIu1/Ry5S4ieumBbNIhslOv1N/zrf/bm46b1 Cw+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=a7BNQtqU1pD6rElJXpAgFiYEXTd8111gFvtpH6it5Kg=; b=SCWMa01JUl5gJsD+jkUjdsmMY/C37afnSC35mLEVZC7io60kir6psahd6tHLWWdoM/ jEQA2jIIV754rnUl0D9tEKGQiE8JBI0aeFmm5H/g9W8n9/BBj6FtDxf5x+Ie/KFrWCiz 5+iNOs3XndJu+Ozde2qUmUtX41KuMDmQfxdOJ9YDkuAKBNqhKi0bsQxCfIluzGyZA8Wo 8KB/jpwL+vbxpnPjdcVIspVhN2uHg3lX20JKWAzV3qqlnjX1vMUkKnqw8ajkXhrxz8u7 zQRhWqfiPhAkn5iczm4aBHjFMjWWG476e9DGixAGuzg1Xq/y7SviUibK3pkX5kgwtj25 bfhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UocgWsUY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si14211551pli.472.2018.08.13.04.27.20; Mon, 13 Aug 2018 04:27:35 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UocgWsUY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729107AbeHMOIQ (ORCPT + 99 others); Mon, 13 Aug 2018 10:08:16 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:42725 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728370AbeHMOIQ (ORCPT ); Mon, 13 Aug 2018 10:08:16 -0400 Received: by mail-yw1-f65.google.com with SMTP id y203-v6so13246039ywd.9 for ; Mon, 13 Aug 2018 04:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a7BNQtqU1pD6rElJXpAgFiYEXTd8111gFvtpH6it5Kg=; b=UocgWsUYoejNkDzMkZNNXLiFDgoxrNkoGMxOhGt/s5a1/ObdOhXtAolyLCMw4yUp8K bH0phXSxiIb/PGeMipgsrNHAaWMIvo67SVRBWBKIFoua/cMzagzbo5cxPnjJqrAOSepU mEcAg72cPMgUpZNVENKAKqNt+QyAnRs+pCGjy52zyOK+3q3fJU/JHebwZvUVGI0Rm7Ac YGE9UPOiE9zxVPRo7IMo4HRZW4LMPEBH8LQe5XoJalnncPjblhUYAJOnirZA+e3ilvyd 4ixnf5lJIzRpeah6XBGLCmEwLJn+NiFXyIyRuzLZAtR0vPY4H8qtlFYaaX3iJ8GkECJx FZLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a7BNQtqU1pD6rElJXpAgFiYEXTd8111gFvtpH6it5Kg=; b=sulHn0PBvPTBxDzOj8lKnkv+w1SuKZCNhHm5RsKQd5wM9qmc61tyZ5giq9mSaX2416 TsmibqX1gE0xU64LG3AR8pN2aAVWUZz+nZy8L9Kt8/j2oCjmXYhdVng0d44ISuY3yUxr 8/3XJQL7JfymPXwyZ8Nd2SRcZ8115bHZ6GMCc9aA0FB5MGf41NZTRcrXb7jPPPw0/RRZ GPg/WByqn9J8wIuzLGXy3YZpV6EyDTzWQQpqsBrXR+gT8KguLRb5euCXesJTPwpCD9bc GlKsGmz5gFOhU4Vl1QS5jvJUtEIU+UCZ74oQ1EuDUpqWcMDB+2JxKD6YoHJ4Xn4h55tt QGAA== X-Gm-Message-State: AOUpUlEQq0XQfgpMHVp5dH1ZU7izjp5wdwARfoPaAazNnTYuQ8aQrKMa lb5Y4iQOBwh0aYDXxZ7ojhUk+eRRbQPW1ttxiANiNCLl X-Received: by 2002:a81:128d:: with SMTP id 135-v6mr9025506yws.107.1534159585703; Mon, 13 Aug 2018 04:26:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:2594:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 04:26:25 -0700 (PDT) In-Reply-To: <1534157699-23637-1-git-send-email-zhongjiang@huawei.com> References: <1534157699-23637-1-git-send-email-zhongjiang@huawei.com> From: Sergio Paracuellos Date: Mon, 13 Aug 2018 13:26:25 +0200 Message-ID: Subject: Re: [PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the open code To: zhong jiang Cc: Greg KH , NeilBrown , peter.vernia@gmail.com, oliver.huebers@web.de, linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > static int mt7621_pcie_request_resources(struct mt7621_pcie *pcie, > -- > 1.7.12.4 >