Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

uio: Constify struct pci_device_id

'struct pci_device_id' is not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increases overall security.

On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
4073 1336 0 5409 1521 drivers/uio/uio_cif.o

After:
=====
text data bss dec hex filename
4233 1176 0 5409 1521 drivers/uio/uio_cif.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/114791f85f0f81531ca2169721eac4911dbe0865.1755629302.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christophe JAILLET and committed by
Greg Kroah-Hartman
511d7a35 1da0ca4b

+4 -4
+1 -1
drivers/uio/uio_aec.c
··· 33 33 34 34 #define MAILBOX 0x0F 35 35 36 - static struct pci_device_id ids[] = { 36 + static const struct pci_device_id ids[] = { 37 37 { PCI_DEVICE(PCI_VENDOR_ID_AEC, PCI_DEVICE_ID_AEC_VITCLTC), }, 38 38 { 0, } 39 39 };
+1 -1
drivers/uio/uio_cif.c
··· 105 105 iounmap(info->mem[0].internal_addr); 106 106 } 107 107 108 - static struct pci_device_id hilscher_pci_ids[] = { 108 + static const struct pci_device_id hilscher_pci_ids[] = { 109 109 { 110 110 .vendor = PCI_VENDOR_ID_PLX, 111 111 .device = PCI_DEVICE_ID_PLX_9030,
+1 -1
drivers/uio/uio_netx.c
··· 127 127 iounmap(info->mem[0].internal_addr); 128 128 } 129 129 130 - static struct pci_device_id netx_pci_ids[] = { 130 + static const struct pci_device_id netx_pci_ids[] = { 131 131 { 132 132 .vendor = PCI_VENDOR_ID_HILSCHER, 133 133 .device = PCI_DEVICE_ID_HILSCHER_NETX,
+1 -1
drivers/uio/uio_sercos3.c
··· 191 191 } 192 192 } 193 193 194 - static struct pci_device_id sercos3_pci_ids[] = { 194 + static const struct pci_device_id sercos3_pci_ids[] = { 195 195 { 196 196 .vendor = PCI_VENDOR_ID_PLX, 197 197 .device = PCI_DEVICE_ID_PLX_9030,