Skip to content

Commit 7af6200

Browse files
tititiou36mmind
authored andcommitted
drm/rockchip: Constify struct drm_encoder_helper_funcs
'struct drm_encoder_helper_funcs' is not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 7458 552 0 8010 1f4a drivers/gpu/drm/rockchip/analogix_dp-rockchip.o After: ===== text data bss dec hex filename 7578 424 0 8002 1f42 drivers/gpu/drm/rockchip/analogix_dp-rockchip.o Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/128f9941aab3b1367eb7abca4ac26e2e5dd6ad21.1720903899.git.christophe.jaillet@wanadoo.fr
1 parent f7f4df8 commit 7af6200

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/rockchip/analogix_dp-rockchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
262262
return 0;
263263
}
264264

265-
static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
265+
static const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
266266
.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
267267
.mode_set = rockchip_dp_drm_encoder_mode_set,
268268
.atomic_enable = rockchip_dp_drm_encoder_enable,

drivers/gpu/drm/rockchip/inno_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
545545
return 0;
546546
}
547547

548-
static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
548+
static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
549549
.atomic_check = inno_hdmi_encoder_atomic_check,
550550
.atomic_enable = inno_hdmi_encoder_enable,
551551
.atomic_disable = inno_hdmi_encoder_disable,

0 commit comments

Comments
 (0)