dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] drm: vmwgfx: constify pci_device_id.
@ 2017-07-15  7:14 Arvind Yadav
  2017-07-18  6:55 ` Sinclair Yeh
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-15  7:14 UTC (permalink / raw)
  To: airlied, linux-graphics-maintainer, linux-kernel, syeh, thellstrom
  Cc: dri-devel

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
  13765	    800	     20	  14585	   38f9	gpu/drm/vmwgfx/vmwgfx_drv.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  13829	    736	     20	  14585	   38f9	gpu/drm/vmwgfx/vmwgfx_drv.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 4a64155..f5fe28f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -227,7 +227,7 @@ static const struct drm_ioctl_desc vmw_ioctls[] = {
 		      DRM_AUTH | DRM_RENDER_ALLOW),
 };
 
-static struct pci_device_id vmw_pci_id_list[] = {
+static const struct pci_device_id vmw_pci_id_list[] = {
 	{0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
 	{0, 0, 0}
 };
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] drm: vmwgfx: constify pci_device_id.
  2017-07-15  7:14 [PATCH 2/5] drm: vmwgfx: constify pci_device_id Arvind Yadav
@ 2017-07-18  6:55 ` Sinclair Yeh
  0 siblings, 0 replies; 2+ messages in thread
From: Sinclair Yeh @ 2017-07-18  6:55 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: airlied, linux-graphics-maintainer, linux-kernel, thellstrom, dri-devel

Thanks.  Queued.

On Sat, Jul 15, 2017 at 12:44:53PM +0530, 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
>   13765	    800	     20	  14585	   38f9	gpu/drm/vmwgfx/vmwgfx_drv.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>   13829	    736	     20	  14585	   38f9	gpu/drm/vmwgfx/vmwgfx_drv.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 4a64155..f5fe28f 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -227,7 +227,7 @@ static const struct drm_ioctl_desc vmw_ioctls[] = {
>  		      DRM_AUTH | DRM_RENDER_ALLOW),
>  };
>  
> -static struct pci_device_id vmw_pci_id_list[] = {
> +static const struct pci_device_id vmw_pci_id_list[] = {
>  	{0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
>  	{0, 0, 0}
>  };
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-18  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-15  7:14 [PATCH 2/5] drm: vmwgfx: constify pci_device_id Arvind Yadav
2017-07-18  6:55 ` Sinclair Yeh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).