lkml.org 
[lkml]   [2017]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] firewire: nosy: constify pci_device_id.
Date
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@gmail.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
\
 
 \ /
  Last update: 2017-07-15 06:39    [W:0.022 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site