Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/aspeed: gfc_crtc: Make structure aspeed_gfx_funcs constant

The static structure aspeed_gfx_funcs, of type
drm_simple_display_pipe_funcs, is used only as an argument to
drm_simple_display_pipe_init(), which does not modify it. Hence make it
constant to protect it from unintended modification.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190813063355.25549-1-nishkadg.linux@gmail.com

authored by

Nishka Dasgupta and committed by
Daniel Vetter
95cbf02b 535d1b94

+1 -1
+1 -1
drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
··· 215 215 writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1); 216 216 } 217 217 218 - static struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = { 218 + static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = { 219 219 .enable = aspeed_gfx_pipe_enable, 220 220 .disable = aspeed_gfx_pipe_disable, 221 221 .update = aspeed_gfx_pipe_update,