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

drm/sun4i: Constify static structs

A number of static variables are not modified and can be made const to
allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804215337.54594-1-rikard.falkeborn@gmail.com

authored by

Rikard Falkeborn and committed by
Maxime Ripard
f13478c9 c84adb30

+15 -15
+1 -1
drivers/gpu/drm/sun4i/sun4i_backend.c
··· 769 769 .vblank_quirk = sun4i_backend_vblank_quirk, 770 770 }; 771 771 772 - static struct regmap_config sun4i_backend_regmap_config = { 772 + static const struct regmap_config sun4i_backend_regmap_config = { 773 773 .reg_bits = 32, 774 774 .val_bits = 32, 775 775 .reg_stride = 4,
+1 -1
drivers/gpu/drm/sun4i/sun4i_framebuffer.c
··· 35 35 .fb_create = drm_gem_fb_create, 36 36 }; 37 37 38 - static struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = { 38 + static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = { 39 39 .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, 40 40 }; 41 41
+1 -1
drivers/gpu/drm/sun4i/sun4i_frontend.c
··· 545 545 } 546 546 EXPORT_SYMBOL(sun4i_frontend_enable); 547 547 548 - static struct regmap_config sun4i_frontend_regmap_config = { 548 + static const struct regmap_config sun4i_frontend_regmap_config = { 549 549 .reg_bits = 32, 550 550 .val_bits = 32, 551 551 .reg_stride = 4,
+1 -1
drivers/gpu/drm/sun4i/sun4i_lvds.c
··· 47 47 return drm_panel_get_modes(lvds->panel, connector); 48 48 } 49 49 50 - static struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = { 50 + static const struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = { 51 51 .get_modes = sun4i_lvds_get_modes, 52 52 }; 53 53
+2 -2
drivers/gpu/drm/sun4i/sun4i_rgb.c
··· 138 138 return MODE_OK; 139 139 } 140 140 141 - static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { 141 + static const struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { 142 142 .get_modes = sun4i_rgb_get_modes, 143 143 }; 144 144 ··· 180 180 } 181 181 } 182 182 183 - static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { 183 + static const struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { 184 184 .disable = sun4i_rgb_encoder_disable, 185 185 .enable = sun4i_rgb_encoder_enable, 186 186 .mode_valid = sun4i_rgb_mode_valid,
+1 -1
drivers/gpu/drm/sun4i/sun4i_tcon.c
··· 825 825 return 0; 826 826 } 827 827 828 - static struct regmap_config sun4i_tcon_regmap_config = { 828 + static const struct regmap_config sun4i_tcon_regmap_config = { 829 829 .reg_bits = 32, 830 830 .val_bits = 32, 831 831 .reg_stride = 4,
+3 -3
drivers/gpu/drm/sun4i/sun4i_tv.c
··· 468 468 regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); 469 469 } 470 470 471 - static struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { 471 + static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { 472 472 .disable = sun4i_tv_disable, 473 473 .enable = sun4i_tv_enable, 474 474 .mode_set = sun4i_tv_mode_set, ··· 504 504 return MODE_OK; 505 505 } 506 506 507 - static struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { 507 + static const struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { 508 508 .get_modes = sun4i_tv_comp_get_modes, 509 509 .mode_valid = sun4i_tv_comp_mode_valid, 510 510 }; ··· 523 523 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, 524 524 }; 525 525 526 - static struct regmap_config sun4i_tv_regmap_config = { 526 + static const struct regmap_config sun4i_tv_regmap_config = { 527 527 .reg_bits = 32, 528 528 .val_bits = 32, 529 529 .reg_stride = 4,
+1 -1
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
··· 820 820 return drm_panel_get_modes(dsi->panel, connector); 821 821 } 822 822 823 - static struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { 823 + static const struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { 824 824 .get_modes = sun6i_dsi_get_modes, 825 825 }; 826 826
+1 -1
drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
··· 534 534 } 535 535 } 536 536 537 - static struct regmap_config sun8i_hdmi_phy_regmap_config = { 537 + static const struct regmap_config sun8i_hdmi_phy_regmap_config = { 538 538 .reg_bits = 32, 539 539 .val_bits = 32, 540 540 .reg_stride = 4,
+1 -1
drivers/gpu/drm/sun4i/sun8i_mixer.c
··· 303 303 .layers_init = sun8i_layers_init, 304 304 }; 305 305 306 - static struct regmap_config sun8i_mixer_regmap_config = { 306 + static const struct regmap_config sun8i_mixer_regmap_config = { 307 307 .reg_bits = 32, 308 308 .val_bits = 32, 309 309 .reg_stride = 4,
+1 -1
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
··· 298 298 true, zpos, old_zpos); 299 299 } 300 300 301 - static struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { 301 + static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { 302 302 .prepare_fb = drm_gem_fb_prepare_fb, 303 303 .atomic_check = sun8i_ui_layer_atomic_check, 304 304 .atomic_disable = sun8i_ui_layer_atomic_disable,
+1 -1
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
··· 401 401 true, zpos, old_zpos); 402 402 } 403 403 404 - static struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { 404 + static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { 405 405 .prepare_fb = drm_gem_fb_prepare_fb, 406 406 .atomic_check = sun8i_vi_layer_atomic_check, 407 407 .atomic_disable = sun8i_vi_layer_atomic_disable,