lkml.org 
[lkml]   [2016]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning
Date
On Tuesday, November 22, 2016 9:45:24 AM CET Ray Jui wrote:
> > diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> > index 857ff5198317..0359569c8d78 100644
> > --- a/drivers/pci/host/pcie-iproc.c
> > +++ b/drivers/pci/host/pcie-iproc.c
> > @@ -936,6 +936,7 @@ static int iproc_pcie_setup_ib(struct iproc_pcie *pcie,
> >
> > }
> > }
> > + ret = -EINVAL;
> > err_ib:
> > dev_err(dev, "unable to configure inbound mapping\n");
> > dev_err(dev, "axi %pap, pci %pap, res size %pap\n",
> >
>
> This change is good, but in my opinion, a further improvement for
> clarity would be to initialize 'ret' to -EINVAL in the beginning of this
> function when 'ret' is declared. What do you think?
>

I never do that, see https://rusty.ozlabs.org/?p=232 for a great
explanation about why.

Arnd

\
 
 \ /
  Last update: 2016-11-22 22:16    [W:1.386 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site