Message ID | 1500102738-23274-2-git-send-email-arvind.yadav.cs@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am 15.07.2017 um 09:12 schrieb Arvind Yadav: > 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 > 6560 23212 72 29844 7494 gpu/drm/radeon/radeon_drv.o > > File size After adding 'const': > text data bss dec hex filename > 28960 812 72 29844 7494 gpu/drm/radeon/radeon_drv.o > > Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Impressive result for such a simple change. Patch is Reviewed-by: Christian König <christian.koenig@amd.com> Are the PCI IDs already const in amdgpu or do we need a similar patch there as well? I only see patch 1 of 5 in my inbox. Christian. > --- > drivers/gpu/drm/radeon/radeon_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c > index e25cb51..b079937 100644 > --- a/drivers/gpu/drm/radeon/radeon_drv.c > +++ b/drivers/gpu/drm/radeon/radeon_drv.c > @@ -298,7 +298,7 @@ module_param_named(uvd, radeon_uvd, int, 0444); > MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)"); > module_param_named(vce, radeon_vce, int, 0444); > > -static struct pci_device_id pciidlist[] = { > +static const struct pci_device_id pciidlist[] = { > radeon_PCI_IDS > }; >
Hi Christian, On Saturday 15 July 2017 07:17 PM, Christian König wrote: > Am 15.07.2017 um 09:12 schrieb Arvind Yadav: >> 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 >> 6560 23212 72 29844 7494 >> gpu/drm/radeon/radeon_drv.o >> >> File size After adding 'const': >> text data bss dec hex filename >> 28960 812 72 29844 7494 >> gpu/drm/radeon/radeon_drv.o >> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> > > Impressive result for such a simple change. > > Patch is Reviewed-by: Christian König <christian.koenig@amd.com> > > Are the PCI IDs already const in amdgpu or do we need a similar patch > there as well? I only see patch 1 of 5 in my inbox. I have send all gpu patch to David Airlie. Please check with him. > > Christian. > >> --- >> drivers/gpu/drm/radeon/radeon_drv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c >> b/drivers/gpu/drm/radeon/radeon_drv.c >> index e25cb51..b079937 100644 >> --- a/drivers/gpu/drm/radeon/radeon_drv.c >> +++ b/drivers/gpu/drm/radeon/radeon_drv.c >> @@ -298,7 +298,7 @@ module_param_named(uvd, radeon_uvd, int, 0444); >> MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, >> 0 = disable)"); >> module_param_named(vce, radeon_vce, int, 0444); >> -static struct pci_device_id pciidlist[] = { >> +static const struct pci_device_id pciidlist[] = { >> radeon_PCI_IDS >> }; > > > Regards, ~arvind
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index e25cb51..b079937 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -298,7 +298,7 @@ module_param_named(uvd, radeon_uvd, int, 0444); MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)"); module_param_named(vce, radeon_vce, int, 0444); -static struct pci_device_id pciidlist[] = { +static const struct pci_device_id pciidlist[] = { radeon_PCI_IDS };
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 6560 23212 72 29844 7494 gpu/drm/radeon/radeon_drv.o File size After adding 'const': text data bss dec hex filename 28960 812 72 29844 7494 gpu/drm/radeon/radeon_drv.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> --- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)