* Sparse warning in AHCI
@ 2008-09-08 16:28 Stephen Hemminger
2008-09-08 19:12 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2008-09-08 16:28 UTC (permalink / raw)
To: Jeff Garzik, Tejun Heo; +Cc: linux-ide
Not sure how you want to fix this:
CHECK drivers/acpi/pci_irq.c
drivers/ata/ahci.c:323:2: warning: Initializer entry defined twice
drivers/ata/ahci.c:324:3: also defined here
This happens because macro ATA_BASE_SHT(drv_name) defines .can_queue
then then later in the initializer for ahci_sht, it gets redefined.
Granted it probably works now, but sparse is correct to complain that
this is bad usage.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sparse warning in AHCI
2008-09-08 16:28 Sparse warning in AHCI Stephen Hemminger
@ 2008-09-08 19:12 ` Tejun Heo
2008-09-08 21:21 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2008-09-08 19:12 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jeff Garzik, linux-ide
Stephen Hemminger wrote:
> Not sure how you want to fix this:
>
> CHECK drivers/acpi/pci_irq.c
> drivers/ata/ahci.c:323:2: warning: Initializer entry defined twice
> drivers/ata/ahci.c:324:3: also defined here
>
> This happens because macro ATA_BASE_SHT(drv_name) defines .can_queue
> then then later in the initializer for ahci_sht, it gets redefined.
>
> Granted it probably works now, but sparse is correct to complain that
> this is bad usage.
>
Hmm... That use is pretty much intentional to provide generic default
initial value and allow specific drivers to override if necessary and I
believe it's a valid C usage, no?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sparse warning in AHCI
2008-09-08 19:12 ` Tejun Heo
@ 2008-09-08 21:21 ` Stephen Hemminger
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2008-09-08 21:21 UTC (permalink / raw)
To: Tejun Heo; +Cc: Jeff Garzik, linux-ide
On Mon, 08 Sep 2008 21:12:10 +0200
Tejun Heo <htejun@gmail.com> wrote:
> Stephen Hemminger wrote:
> > Not sure how you want to fix this:
> >
> > CHECK drivers/acpi/pci_irq.c
> > drivers/ata/ahci.c:323:2: warning: Initializer entry defined twice
> > drivers/ata/ahci.c:324:3: also defined here
> >
> > This happens because macro ATA_BASE_SHT(drv_name) defines .can_queue
> > then then later in the initializer for ahci_sht, it gets redefined.
> >
> > Granted it probably works now, but sparse is correct to complain that
> > this is bad usage.
> >
>
> Hmm... That use is pretty much intentional to provide generic default
> initial value and allow specific drivers to override if necessary and I
> believe it's a valid C usage, no?
IANAL as Viro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-08 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 16:28 Sparse warning in AHCI Stephen Hemminger
2008-09-08 19:12 ` Tejun Heo
2008-09-08 21:21 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).