[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140424212246.GG29593@google.com>
Date: Thu, 24 Apr 2014 15:22:46 -0600
From: Bjorn Helgaas <bhelgaas@...gle.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Mark Rustad <mark.d.rustad@...el.com>,
linux-pci@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] pci: Use designated initialization in PCI_VDEVICE
On Tue, Apr 01, 2014 at 02:08:06AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 04/01/2014 01:58 AM, Jeff Kirsher wrote:
>
> >From: Mark Rustad <mark.d.rustad@...el.com>
>
> >By using designated initialization in PCI_VDEVICE, like other
> >similar macros, many "missing initializer" warnings that appear
> >when compiling with W=2 can be silenced.
>
> >Signed-off-by: Mark Rustad <mark.d.rustad@...el.com>
> >Tested-by: Phil Schmitt <phillip.j.schmitt@...el.com>
> >Tested-by: Aaron Brown <aaron.f.brown@...el.com>
> >Tested-by: Kavindya Deegala <kavindya.s.deegala@...el.com>
> >Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> >---
> > include/linux/pci.h | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
>
> >diff --git a/include/linux/pci.h b/include/linux/pci.h
> >index fb57c89..49455f9 100644
> >--- a/include/linux/pci.h
> >+++ b/include/linux/pci.h
> [...]
> >@@ -689,9 +689,9 @@ struct pci_driver {
> > * private data.
> > */
> >
> >-#define PCI_VDEVICE(vendor, device) \
> >- PCI_VENDOR_ID_##vendor, (device), \
> >- PCI_ANY_ID, PCI_ANY_ID, 0, 0
> >+#define PCI_VDEVICE(vend, dev) \
> >+ .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
> >+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
>
> Initializing the fields to 0 is pointless, as 0 is what should be
> put into them anyway by the compiler. Also, it doesn't look right
> when you mix designated and anonymous initializers.
I'm certainly willing to apply this, but I can't reproduce the benefit. I
tried "make W=2 drivers/net/ethernet/intel/e1000e/netdev.o" and didn't see
any change before and after this patch (I'm using Ubuntu gcc 4.6.3 if it
matters).
What am I missing? And do we need the zeroes?
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists