From: Marek Vasut <marek.vasut@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@shadowen.org>, linux-kernel@vger.kernel.org
Subject: Re: checkpatch.pl misreporting bugs with array fillings
Date: Sat, 17 Dec 2011 01:22:55 +0100 [thread overview]
Message-ID: <201112170122.55827.marek.vasut@gmail.com> (raw)
In-Reply-To: <1324080955.331.16.camel@joe2Laptop>
> On Fri, 2011-12-16 at 22:59 +0100, Marek Vasut wrote:
> > static const unsigned char pci_irq_swizzle[2][PCI_MAX_DEVICES] = {
> >
> > {0, 0, 0, 0, 0, 0, 0, 27, 27, [9 ... PCI_MAX_DEVICES - 1] = 0 },
> > {0, 0, 0, 0, 0, 0, 0, 29, 29, [9 ... PCI_MAX_DEVICES - 1] = 0 },
> >
> > };
>
> True.
>
> Andy will probably figure it out.
> He's the maintainer.
>
> Still, in this case all the 0's are unnecessary.
> I'd probably write that code as:
>
> static const unsigned char pci_irq_swizzle[2][PCI_MAX_DEVICES] = {
> { [7] = 27, [8] = 27 },
> { [7] = 29, [8] = 29 },
> };
I suspect this is some remnant of ancient code where the people writing it were
not sure if the memory under this is all-zeroes. (or the section this lands in
wasn't zeroed-out)
M
prev parent reply other threads:[~2011-12-17 0:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-16 21:59 checkpatch.pl misreporting bugs with array fillings Marek Vasut
2011-12-16 22:24 ` Andy Whitcroft
2011-12-16 22:31 ` Marek Vasut
2011-12-19 10:13 ` Andy Whitcroft
2011-12-17 0:15 ` Joe Perches
2011-12-17 0:22 ` Marek Vasut [this message]
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=201112170122.55827.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=apw@shadowen.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox