[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMhs-H9+FBfjvtYb0ehoAz7hHaaoKiO6-Ypmb+q-aXRO-xYG6Q@mail.gmail.com>
Date: Mon, 13 Aug 2018 13:26:25 +0200
From: Sergio Paracuellos <sergio.paracuellos@...il.com>
To: zhong jiang <zhongjiang@...wei.com>
Cc: Greg KH <gregkh@...uxfoundation.org>, NeilBrown <neil@...wn.name>,
peter.vernia@...il.com, oliver.huebers@....de,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the
open code
On Mon, Aug 13, 2018 at 12:54 PM, zhong jiang <zhongjiang@...wei.com> 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 <zhongjiang@...wei.com>
> ---
> 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
>
Powered by blists - more mailing lists