Commit a5cb37d8 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Daniel Vetter

drm: make drm_mode_config_func const

Make these structures const as they are only stored in the funcs field
of a drm_mode_config structure which is of type const.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
@@
static struct drm_mode_config_funcs s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier y;
position ref.p;
identifier match.s;
@@
struct drm_mode_config y = {...,.funcs=&s@p,...};

@good2@
struct drm_mode_config y;
identifier match.s;
position ref.p;
@@
y.funcs = &s@p

@bad depends on  !good1 && !good2@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct drm_mode_config_funcs s;
Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502204751-16525-1-git-send-email-bhumirks@gmail.com
parent 91b39a4e
...@@ -31,7 +31,7 @@ static void arcpgu_fb_output_poll_changed(struct drm_device *dev) ...@@ -31,7 +31,7 @@ static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
drm_fbdev_cma_hotplug_event(arcpgu->fbdev); drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
} }
static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = { static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
.fb_create = drm_fb_cma_create, .fb_create = drm_fb_cma_create,
.output_poll_changed = arcpgu_fb_output_poll_changed, .output_poll_changed = arcpgu_fb_output_poll_changed,
.atomic_check = drm_atomic_helper_check, .atomic_check = drm_atomic_helper_check,
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#define DRIVER_DESC "DRM module for PL111" #define DRIVER_DESC "DRM module for PL111"
static struct drm_mode_config_funcs mode_config_funcs = { static const struct drm_mode_config_funcs mode_config_funcs = {
.fb_create = drm_fb_cma_create, .fb_create = drm_fb_cma_create,
.atomic_check = drm_atomic_helper_check, .atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit, .atomic_commit = drm_atomic_helper_commit,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment