hwmon: (i5k_amb) constify pci_device_id
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Mon, 17 Jul 2017 16:25:10 +0000 (21:55 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 13 Aug 2017 15:24:38 +0000 (08:24 -0700)
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
   3562     320       8    3890     f32 drivers/hwmon/i5k_amb.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   3658     224       8    3890     f32 drivers/hwmon/i5k_amb.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/i5k_amb.c

index a5a9f457b7f7a8512f7a1e50a177fedaf5fa91a6..9397d2f0e79ac0710feb06e6f15e3673b9a0fc5f 100644 (file)
@@ -495,7 +495,7 @@ static struct {
 };
 
 #ifdef MODULE
-static struct pci_device_id i5k_amb_ids[] = {
+static const struct pci_device_id i5k_amb_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR) },
        { 0, }