lkml.org 
[lkml]   [2017]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: gadget: udc: net2272: 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
19453 2260 5 21718 54d6 drivers/usb/gadget/udc/net2272.o

File size After adding 'const':
text data bss dec hex filename
19549 2164 5 21718 54d6 drivers/usb/gadget/udc/net2272.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/usb/gadget/udc/net2272.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 8f85a51..91ab2ad80 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -2556,7 +2556,7 @@ net2272_pci_remove(struct pci_dev *pdev)
}

/* Table of matching PCI IDs */
-static struct pci_device_id pci_ids[] = {
+static const struct pci_device_id pci_ids[] = {
{ /* RDK 1 card */
.class = ((PCI_CLASS_BRIDGE_OTHER << 8) | 0xfe),
.class_mask = 0,
--
2.7.4
\
 
 \ /
  Last update: 2017-07-16 08:49    [W:0.026 / U:0.204 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site