All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ray Jui <ray.jui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>,
	Jon Mason <jonmason@broadcom.com>, Ray Jui <rjui@broadcom.com>,
	linux-kernel@vger.kernel.org, Oza Oza <oza.oza@broadcom.com>,
	"Dmitry V. Krivenok" <krivenok.dmitry@gmail.com>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning
Date: Tue, 22 Nov 2016 22:15:08 +0100	[thread overview]
Message-ID: <2504851.C6gOdhdaGF@wuerfel> (raw)
In-Reply-To: <31c4c52b-3de5-2277-7a44-2a4231531074@broadcom.com>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning
Date: Tue, 22 Nov 2016 22:15:08 +0100	[thread overview]
Message-ID: <2504851.C6gOdhdaGF@wuerfel> (raw)
In-Reply-To: <31c4c52b-3de5-2277-7a44-2a4231531074@broadcom.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Ray Jui <ray.jui@broadcom.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Jon Mason <jonmason@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Oza Oza <oza.oza@broadcom.com>,
	"Dmitry V. Krivenok" <krivenok.dmitry@gmail.com>,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning
Date: Tue, 22 Nov 2016 22:15:08 +0100	[thread overview]
Message-ID: <2504851.C6gOdhdaGF@wuerfel> (raw)
In-Reply-To: <31c4c52b-3de5-2277-7a44-2a4231531074@broadcom.com>

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

  reply	other threads:[~2016-11-22 21:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 14:17 [PATCH 1/2] PCI: iproc: fix 32-bit build Arnd Bergmann
2016-11-22 14:17 ` Arnd Bergmann
2016-11-22 14:17 ` Arnd Bergmann
2016-11-22 14:17 ` [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning Arnd Bergmann
2016-11-22 14:17   ` Arnd Bergmann
2016-11-22 17:45   ` Ray Jui
2016-11-22 17:45     ` Ray Jui
2016-11-22 21:15     ` Arnd Bergmann [this message]
2016-11-22 21:15       ` Arnd Bergmann
2016-11-22 21:15       ` Arnd Bergmann
2016-11-23  3:00       ` Ray Jui
2016-11-23  3:00         ` Ray Jui
2016-11-22 17:42 ` [PATCH 1/2] PCI: iproc: fix 32-bit build Ray Jui
2016-11-22 17:42   ` Ray Jui
2016-11-22 21:13   ` Arnd Bergmann
2016-11-22 21:13     ` Arnd Bergmann
2016-11-22 21:13     ` Arnd Bergmann
2016-11-23  2:59     ` Ray Jui
2016-11-23  2:59       ` Ray Jui
2016-11-23 22:53 ` Bjorn Helgaas
2016-11-23 22:53   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2504851.C6gOdhdaGF@wuerfel \
    --to=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=jonmason@broadcom.com \
    --cc=krivenok.dmitry@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=oza.oza@broadcom.com \
    --cc=ray.jui@broadcom.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.