Message ID | f6ecfc5c18a47e7b16d58ab55c562b0414595a8c.1500308632.git.arvind.yadav.cs@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On 07/17/2017 09:25 AM, Arvind Yadav wrote: > 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> Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/i5k_amb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c > index a5a9f45..9397d2f 100644 > --- a/drivers/hwmon/i5k_amb.c > +++ b/drivers/hwmon/i5k_amb.c > @@ -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, } > -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index a5a9f45..9397d2f 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c @@ -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, }
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> --- drivers/hwmon/i5k_amb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)