drm/exynos: constify exynos_drm_crtc_ops structures
Subsystems (3)
PATCH 1/1 drm/exynos: constify exynos_drm_crtc_ops structures
Declare exynos_drm_crtc_ops structures as const as they are only passed as an argument to the function exynos_drm_crtc_create. This argument is of type const struct exynos_drm_crtc_ops *, so exynos_drm_crtc_ops structures having this property can be declared const.
Done using Coccinelle:
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct exynos_drm_crtc_ops i@p={...};
@ok@
position p;
identifier r.i;
@@exynos_drm_crtc_create(...,&i@p,...)
@bad@
position p!={r.p,ok.p};
identifier r.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
+const
struct exynos_drm_crtc_ops i;
File size before:
text data bss dec hex filename
5008 280 0 5288 14a8 exynos/exynos5433_drm_decon.o
File size after:
text data bss dec hex filename
5120 176 0 5296 14b0 exynos/exynos5433_drm_decon.o
--- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +1 -1
@@ -470,7 +470,7 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc)clk_disable_unprepare (ctx->clks[i]); } -static struct exynos_drm_crtc_ops decon_crtc_ops = { +static const struct exynos_drm_crtc_ops decon_crtc_ops = { .enable = decon_enable, .disable = decon_disable, .enable_vblank = decon_enable_vblank,
Signature · 1 line
1.9.1
Daniel Vetter
AppliedQuoted 34 lines · Bhumika Goyal
Declare
exynos_drm_crtc_opsstructures as const as they are only passed as an argument to the functionexynos_drm_crtc_create. This argument is of type const structexynos_drm_crtc_ops*, soexynos_drm_crtc_opsstructures having this property can be declared const.
Done using Coccinelle:@r disable optional_qualifier@
identifier i;
position p;
@@
static structexynos_drm_crtc_opsi at p={...};@ok@
position p;
identifier r.i;
@@exynos_drm_crtc_create(...,&i at p,...)@bad@
position p!={r.p,ok.p};
identifier r.i;
@@
i at p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
+const
structexynos_drm_crtc_opsi;File size before:
text data bss dec hex filename
5008 280 0 5288 14a8exynos/exynos5433_drm_decon.o
Quoted 5 lines
File size after:
text data bss dec hex filename
5120 176 0 5296 14b0exynos/exynos5433_drm_decon.oSigned-off-by Bhumika Goyal <[email protected]>
Applied to drm-misc, thanks.
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/exynos/exynos5433_drm_decon.c +1
-1@@ -470,7 +470,7 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc)clk_disable_unprepare (ctx->clks[i]); } -static struct exynos_drm_crtc_ops decon_crtc_ops = { +static const struct exynos_drm_crtc_ops decon_crtc_ops = { .enable = decon_enable, .disable = decon_disable, .enable_vblank = decon_enable_vblank,Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list dri-devel at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch