lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat, 15 Jul 2017 10:08:46 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     stefanr@...6.in-berlin.de, linux1394-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: [PATCH] firewire: nosy: constify pci_device_id.

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   5796	    389	      0	   6185	   1829	drivers/firewire/nosy.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   5860	    325	      0	   6185	   1829	drivers/firewire/nosy.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/firewire/nosy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 180f0a9..d16a9dc9 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -694,7 +694,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
 	return ret;
 }
 
-static struct pci_device_id pci_table[] = {
+static const struct pci_device_id pci_table[] = {
 	{
 		.vendor =    PCI_VENDOR_ID_TI,
 		.device =    PCI_DEVICE_ID_TI_PCILYNX,
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ