public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.
@ 2017-07-03 16:23 Arvind Yadav
  2017-08-03 14:56 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-03 16:23 UTC (permalink / raw)
  To: boris.brezillon, airlied, daniel.vetter; +Cc: dri-devel, linux-kernel

drm_plane_helper_funcs and drm_plane_funcsare not supposed to change
at runtime. All functions working with drm_plane_helper_funcs and
drm_plane_funcs work with const. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   6072	    596	      0	   6668	   1a0c atmel_hlcdc_plane.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   6218	    436	      0	   6654	   19fe atmel_hlcdc_plane.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 29cc10d..ea72e1f 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -911,7 +911,7 @@ void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane)
 			desc->name);
 }
 
-static struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = {
+static const struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = {
 	.atomic_check = atmel_hlcdc_plane_atomic_check,
 	.atomic_update = atmel_hlcdc_plane_atomic_update,
 	.atomic_disable = atmel_hlcdc_plane_atomic_disable,
@@ -1020,7 +1020,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
 	kfree(state);
 }
 
-static struct drm_plane_funcs layer_plane_funcs = {
+static const struct drm_plane_funcs layer_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.set_property = drm_atomic_helper_plane_set_property,
-- 
2.7.4

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

* Re: [PATCH] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.
  2017-07-03 16:23 [PATCH] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs Arvind Yadav
@ 2017-08-03 14:56 ` Boris Brezillon
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2017-08-03 14:56 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: airlied, daniel.vetter, dri-devel, linux-kernel

On Mon,  3 Jul 2017 21:53:54 +0530
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:

> drm_plane_helper_funcs and drm_plane_funcsare not supposed to change
> at runtime. All functions working with drm_plane_helper_funcs and
> drm_plane_funcs work with const. So mark the non-const structs as const.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>    6072	    596	      0	   6668	   1a0c atmel_hlcdc_plane.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    6218	    436	      0	   6654	   19fe atmel_hlcdc_plane.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Applied to drm-misc-next.

Thanks,

Boris

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 29cc10d..ea72e1f 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -911,7 +911,7 @@ void atmel_hlcdc_plane_irq(struct atmel_hlcdc_plane *plane)
>  			desc->name);
>  }
>  
> -static struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = {
> +static const struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = {
>  	.atomic_check = atmel_hlcdc_plane_atomic_check,
>  	.atomic_update = atmel_hlcdc_plane_atomic_update,
>  	.atomic_disable = atmel_hlcdc_plane_atomic_disable,
> @@ -1020,7 +1020,7 @@ static void atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
>  	kfree(state);
>  }
>  
> -static struct drm_plane_funcs layer_plane_funcs = {
> +static const struct drm_plane_funcs layer_plane_funcs = {
>  	.update_plane = drm_atomic_helper_update_plane,
>  	.disable_plane = drm_atomic_helper_disable_plane,
>  	.set_property = drm_atomic_helper_plane_set_property,

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

end of thread, other threads:[~2017-08-03 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 16:23 [PATCH] drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs Arvind Yadav
2017-08-03 14:56 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox