* [PATCH 0/5] constify drm pci_device_id @ 2017-07-15 7:12 Arvind Yadav 2017-07-15 7:12 ` [PATCH 1/5] drm: radeon: constify pci_device_id Arvind Yadav 0 siblings, 1 reply; 4+ messages in thread From: Arvind Yadav @ 2017-07-15 7:12 UTC (permalink / raw) To: airlied, amd-gfx, alexander.deucher, dri-devel; +Cc: linux-kernel 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. Arvind Yadav (5): [PATCH 1/5] drm: radeon: constify pci_device_id. [PATCH 2/5] drm: vmwgfx: constify pci_device_id. [PATCH 3/5] drm: nouveau: constify pci_device_id. [PATCH 4/5] drm: via: constify pci_device_id. [PATCH 5/5] drm: hisilicon: constify pci_device_id. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/via/via_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/5] drm: radeon: constify pci_device_id. 2017-07-15 7:12 [PATCH 0/5] constify drm pci_device_id Arvind Yadav @ 2017-07-15 7:12 ` Arvind Yadav 2017-07-15 13:47 ` Christian König 0 siblings, 1 reply; 4+ messages in thread From: Arvind Yadav @ 2017-07-15 7:12 UTC (permalink / raw) To: airlied, amd-gfx, alexander.deucher, dri-devel; +Cc: linux-kernel 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(-) 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 }; -- 2.7.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/5] drm: radeon: constify pci_device_id. 2017-07-15 7:12 ` [PATCH 1/5] drm: radeon: constify pci_device_id Arvind Yadav @ 2017-07-15 13:47 ` Christian König 2017-07-16 6:10 ` arvind 0 siblings, 1 reply; 4+ messages in thread From: Christian König @ 2017-07-15 13:47 UTC (permalink / raw) To: Arvind Yadav, airlied, amd-gfx, alexander.deucher, dri-devel; +Cc: linux-kernel 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 > }; > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/5] drm: radeon: constify pci_device_id. 2017-07-15 13:47 ` Christian König @ 2017-07-16 6:10 ` arvind 0 siblings, 0 replies; 4+ messages in thread From: arvind @ 2017-07-16 6:10 UTC (permalink / raw) To: Christian König, airlied, amd-gfx, alexander.deucher, dri-devel Cc: linux-kernel [-- Attachment #1.1: Type: text/plain, Size: 1788 bytes --] 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 [-- Attachment #1.2: Type: text/html, Size: 4598 bytes --] [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-16 6:10 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-07-15 7:12 [PATCH 0/5] constify drm pci_device_id Arvind Yadav 2017-07-15 7:12 ` [PATCH 1/5] drm: radeon: constify pci_device_id Arvind Yadav 2017-07-15 13:47 ` Christian König 2017-07-16 6:10 ` arvind
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox