Thread (30 messages) 30 messages, 2 authors, 2017-08-01

[PATCH 17/28] video: fbdev: nvidia: constify pci_device_id.

From: Arvind Yadav <hidden>
Date: 2017-07-20 17:41:05
Also in: lkml
Subsystem: framebuffer layer, nvidia (rivafb and nvidiafb) framebuffer driver, the rest · Maintainers: Helge Deller, Antonino Daplas, Linus Torvalds

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
  12149	    768	     36	  12953	   3299	video/fbdev/nvidia/nvidia.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  12213	    704	     36	  12953	   3299	video/fbdev/nvidia/nvidia.o

Signed-off-by: Arvind Yadav <redacted>
---
 drivers/video/fbdev/nvidia/nvidia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c
index ce7dab7..418a2d0 100644
--- a/drivers/video/fbdev/nvidia/nvidia.c
+++ b/drivers/video/fbdev/nvidia/nvidia.c
@@ -55,7 +55,7 @@
 /* HW cursor parameters */
 #define MAX_CURS		32
 
-static struct pci_device_id nvidiafb_pci_tbl[] = {
+static const struct pci_device_id nvidiafb_pci_tbl[] = {
 	{PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 	 PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0},
 	{ 0, }
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help