Skip to contentSkip to conversation

Sparse warning in sata_nv.c

DISCUSSION Stephen Hemminger 2 participants 2 messages Jan 6, 2010 – Jan 20, 2010 libata

lore
Share & tools
lore
#0 lore raw

Sparse complains about the following, not sure best way to fix it. Either change ATA_NCQ_SHT() or do manual expansion.

Signature · 5 lines
 CHECK   drivers/ata/sata_nv.c
drivers/ata/sata_nv.c:394:9: warning: Initializer entry defined twice
drivers/ata/sata_nv.c:398:10:   also defined here
drivers/ata/sata_nv.c:402:9: warning: Initializer entry defined twice
drivers/ata/sata_nv.c:406:10:   also defined here
#1 lore raw
Quoted 2 lines · Stephen Hemminger

Sparse complains about the following, not sure best way to fix it. Either change ATA_NCQ_SHT() or do manual expansion.

Hmm... that's an intended abuse of duplicate initializers. The macro provides stock values and each driver overrides fields as necessary with duplicate initializers which come below the macro. It would be great if there's a way to tell sparse that an initializer may be overridden.

Thanks.

Signature · 1 line
tejun