Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680467 > unrolled thread

[PATCH] drm/sun4i : constify drm_plane_helper_funcs

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-07-03 18:10 +0200
Last post2017-07-03 23:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/sun4i : constify drm_plane_helper_funcs Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-03 18:10 +0200
    Re: [PATCH] drm/sun4i : constify drm_plane_helper_funcs Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-03 23:40 +0200

#1680467 — [PATCH] drm/sun4i : constify drm_plane_helper_funcs

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-03 18:10 +0200
Subject[PATCH] drm/sun4i : constify drm_plane_helper_funcs
Message-ID<tZc5c-3Q7-23@gated-at.bofh.it>
drm_plane_helper_funcs are not supposed to change at runtime.
All functions working with drm_plane_helper_funcs provided by
<drm/drm_plane_helper.h> work with const drm_plane_helper_funcs.
So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
    981	     40	      0	   1021	    3fd drivers/gpu/drm/sun4i/sun4i_layer.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   1021	      0	      0	   1021	    3fd drivers/gpu/drm/sun4i/sun4i_layer.o

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

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index f26bde5..6191aac 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -52,7 +52,7 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
 	sun4i_backend_layer_enable(backend, layer->id, true);
 }
 
-static struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = {
+static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = {
 	.atomic_check	= sun4i_backend_layer_atomic_check,
 	.atomic_disable	= sun4i_backend_layer_atomic_disable,
 	.atomic_update	= sun4i_backend_layer_atomic_update,
-- 
2.7.4

[toc] | [next] | [standalone]


#1680598

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-07-03 23:40 +0200
Message-ID<tZhey-7h6-13@gated-at.bofh.it>
In reply to#1680467

[Multipart message — attachments visible in raw view] — view raw

On Mon, Jul 03, 2017 at 09:35:20PM +0530, Arvind Yadav wrote:
> drm_plane_helper_funcs are not supposed to change at runtime.
> All functions working with drm_plane_helper_funcs provided by
> <drm/drm_plane_helper.h> work with const drm_plane_helper_funcs.
> So mark the non-const structs as const.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>     981	     40	      0	   1021	    3fd drivers/gpu/drm/sun4i/sun4i_layer.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    1021	      0	      0	   1021	    3fd drivers/gpu/drm/sun4i/sun4i_layer.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Queued for 4.14, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web