Skip to contentSkip to conversation

drm: Constify drm_mode_config atomic helper private pointer

PATCH Applied Laurent Pinchart 4 participants 4 messages Jan 2, 2017 – Feb 12, 2017

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Constify drm_mode_config atomic helper private pointer

The drm_mode_config helper private field points to a structure of function pointers that don't need to be modified at runtime. Make it const.

---
 drivers/gpu/drm/arm/malidp_drv.c           | 2 +-
 drivers/gpu/drm/drm_atomic_helper.c        | 2 +-
 drivers/gpu/drm/imx/imx-drm-core.c         | 2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 2 +-
 drivers/gpu/drm/virtio/virtgpu_display.c   | 2 +-
 include/drm/drm_mode_config.h              | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/arm/malidp_drv.c +1 -1
index 32f746e31379..64babce654e4 100644
@@ -101,7 +101,7 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)
 	drm_atomic_helper_cleanup_planes(drm, state);
 }
 
-static struct drm_mode_config_helper_funcs malidp_mode_config_helpers = {
+static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = {
 	.atomic_commit_tail = malidp_atomic_commit_tail,
 };
 
drivers/gpu/drm/drm_atomic_helper.c +1 -1
index 583f47f27b36..2099868ee9f7 100644
@@ -1197,7 +1197,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_tail);
 static void commit_tail(struct drm_atomic_state *old_state)
 {
 	struct drm_device *dev = old_state->dev;
-	struct drm_mode_config_helper_funcs *funcs;
+	const struct drm_mode_config_helper_funcs *funcs;
 
 	funcs = dev->mode_config.helper_private;
 
drivers/gpu/drm/imx/imx-drm-core.c +1 -1
index 33404295b447..da9ae4f20aec 100644
@@ -176,7 +176,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
 	drm_atomic_helper_cleanup_planes(dev, state);
 }
 
-static struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {
+static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {
 	.atomic_commit_tail = imx_drm_atomic_commit_tail,
 };
 
drivers/gpu/drm/rockchip/rockchip_drm_fb.c +1 -1
index 0f6eda023bd0..233497402246 100644
@@ -193,7 +193,7 @@ rockchip_atomic_commit_tail(struct drm_atomic_state *state)
 	drm_atomic_helper_cleanup_planes(dev, state);
 }
 
-static struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
+static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
 	.atomic_commit_tail = rockchip_atomic_commit_tail,
 };
 
drivers/gpu/drm/virtio/virtgpu_display.c +1 -1
index 58048709c34e..10aa44d60344 100644
@@ -346,7 +346,7 @@ static void vgdev_atomic_commit_tail(struct drm_atomic_state *state)
 	drm_atomic_helper_cleanup_planes(dev, state);
 }
 
-static struct drm_mode_config_helper_funcs virtio_mode_config_helpers = {
+static const struct drm_mode_config_helper_funcs virtio_mode_config_helpers = {
 	.atomic_commit_tail = vgdev_atomic_commit_tail,
 };
 
include/drm/drm_mode_config.h +1 -1
index bf9991b20611..88725cb355d7 100644
@@ -653,7 +653,7 @@ struct drm_mode_config {
 	/* cursor size */
 	uint32_t cursor_width, cursor_height;
 
-	struct drm_mode_config_helper_funcs *helper_private;
+	const struct drm_mode_config_helper_funcs *helper_private;
 };
 
 void drm_mode_config_init(struct drm_device *dev);
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Laurent Pinchart

The drm_mode_config helper private field points to a structure of function pointers that don't need to be modified at runtime. Make it const.

Signature · 5 lines
Gabriel Krisman Bertazi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 7 lines · Gabriel Krisman Bertazi
Quoted 3 lines · Laurent Pinchart

The drm_mode_config helper private field points to a structure of function pointers that don't need to be modified at runtime. Make it const.

Applied to drm-misc, thanks for patch&review.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#3 lore raw
In reply to Laurent Pinchart
Quoted 5 lines · Laurent Pinchart

The drm_mode_config helper private field points to a structure of function pointers that don't need to be modified at runtime. Make it const.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel