Thread (15 messages) 15 messages, 9 authors, 2014-07-22

Re: [PATCH 0/25] Replace DEFINE_PCI_DEVICE_TABLE macro use

From: "Keller, Jacob E" <jacob.e.keller@intel.com>
Date: 2014-07-18 16:33:16
Also in: dri-devel, linux-can, linux-crypto, linux-mmc, linux-rdma, linux-scsi, netdev, platform-driver-x86

On Fri, 2014-07-18 at 09:28 -0700, James Bottomley wrote:
On Fri, 2014-07-18 at 17:26 +0200, Benoit Taine wrote:
quoted
We should prefer `const struct pci_device_id` over
`DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines.
This issue was reported by checkpatch.
What kernel coding style?  checkpatch isn't the arbiter of style, if
that's the only problem.

The DEFINE_PCI macro was a well reasoned addition when it was added in
2008.  The problem was most people were getting the definition wrong.
When we converted away from CONFIG_HOTPLUG, having this DEFINE_ meant
that only one place needed changing instead of hundreds for PCI tables.

The reason people were getting the PCI table wrong was mostly the init
section specifiers which are now gone, but it has enough underlying
utility (mostly constification) that I don't think we'd want to churn
the kernel hugely to make a change to struct pci_table and then have to
start detecting and fixing misuses.

James


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
I would rather fix the misuses of the macro, than remove it. Could we
possibly make checkpatch smart enough to tell when the macro is misused?

Thanks,
Jake
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help