All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers
@ 2015-04-13  8:21 Jani Nikula
  2015-04-13  8:21 ` [PATCH 2/3] drm/armada: constify struct drm_encoder_helper_funcs pointer Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jani Nikula @ 2015-04-13  8:21 UTC (permalink / raw)
  To: dri-devel; +Cc: jani.nikula, christian.koenig

Some non-const pointers were added since the last constification, fix
them.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++--
 drivers/gpu/drm/radeon/radeon_dp_mst.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index f150c2495fa4..cebb65e07e1d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -751,7 +751,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct
 		if (connector->encoder)
 			radeon_encoder = to_radeon_encoder(connector->encoder);
 		else {
-			struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
+			const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
 			radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector));
 		}
 
@@ -762,7 +762,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct
 
 		if (connector->encoder->crtc) {
 			struct drm_crtc *crtc  = connector->encoder->crtc;
-			struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
+			const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
 			struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
 
 			radeon_crtc->output_csc = radeon_encoder->output_csc;
diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index 5952ff2bb647..1017338a49d9 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -604,7 +604,7 @@ radeon_dp_create_fake_mst_encoder(struct radeon_connector *connector)
 	struct radeon_encoder *radeon_encoder;
 	struct radeon_encoder_mst *mst_enc;
 	struct drm_encoder *encoder;
-	struct drm_connector_helper_funcs *connector_funcs = connector->base.helper_private;
+	const struct drm_connector_helper_funcs *connector_funcs = connector->base.helper_private;
 	struct drm_encoder *enc_master = connector_funcs->best_encoder(&connector->base);
 
 	DRM_DEBUG_KMS("enc master is %p\n", enc_master);
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] drm/armada: constify struct drm_encoder_helper_funcs pointer
  2015-04-13  8:21 [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Jani Nikula
@ 2015-04-13  8:21 ` Jani Nikula
  2015-04-13  8:21 ` [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer Jani Nikula
  2015-04-13  8:28 ` [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Christian König
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2015-04-13  8:21 UTC (permalink / raw)
  To: dri-devel; +Cc: jani.nikula, christian.koenig

Not to be modified.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/armada/armada_output.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_output.h b/drivers/gpu/drm/armada/armada_output.h
index 4126d43b5057..3c4023e142d0 100644
--- a/drivers/gpu/drm/armada/armada_output.h
+++ b/drivers/gpu/drm/armada/armada_output.h
@@ -9,7 +9,7 @@
 #define ARMADA_CONNETOR_H
 
 #define encoder_helper_funcs(encoder) \
-	((struct drm_encoder_helper_funcs *)encoder->helper_private)
+	((const struct drm_encoder_helper_funcs *)encoder->helper_private)
 
 struct armada_output_type {
 	int connector_type;
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer
  2015-04-13  8:21 [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Jani Nikula
  2015-04-13  8:21 ` [PATCH 2/3] drm/armada: constify struct drm_encoder_helper_funcs pointer Jani Nikula
@ 2015-04-13  8:21 ` Jani Nikula
  2015-04-13  8:25   ` Jani Nikula
  2015-04-13  8:28 ` [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Christian König
  2 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2015-04-13  8:21 UTC (permalink / raw)
  To: dri-devel; +Cc: jani.nikula, christian.koenig

They're only used to store const pointers anyway. This helps to keep
Ville and the compiler happy.

Christian König <christian.koenig@amd.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/drm/drm_crtc.h         | 8 ++++----
 include/drm/drm_crtc_helper.h  | 6 +++---
 include/drm/drm_plane_helper.h | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 150b93c29150..d4e4b82da3ad 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -466,7 +466,7 @@ struct drm_crtc {
 	int framedur_ns, linedur_ns, pixeldur_ns;
 
 	/* if you are using the helper */
-	void *helper_private;
+	const void *helper_private;
 
 	struct drm_object_properties properties;
 
@@ -596,7 +596,7 @@ struct drm_encoder {
 	struct drm_crtc *crtc;
 	struct drm_bridge *bridge;
 	const struct drm_encoder_funcs *funcs;
-	void *helper_private;
+	const void *helper_private;
 };
 
 /* should we poll this connector for connects and disconnects */
@@ -700,7 +700,7 @@ struct drm_connector {
 	/* requested DPMS state */
 	int dpms;
 
-	void *helper_private;
+	const void *helper_private;
 
 	/* forced on connector */
 	struct drm_cmdline_mode cmdline_mode;
@@ -863,7 +863,7 @@ struct drm_plane {
 
 	enum drm_plane_type type;
 
-	void *helper_private;
+	const void *helper_private;
 
 	struct drm_plane_state *state;
 };
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index 92d5135b55d2..c8fc187061de 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -197,19 +197,19 @@ extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
 static inline void drm_crtc_helper_add(struct drm_crtc *crtc,
 				       const struct drm_crtc_helper_funcs *funcs)
 {
-	crtc->helper_private = (void *)funcs;
+	crtc->helper_private = funcs;
 }
 
 static inline void drm_encoder_helper_add(struct drm_encoder *encoder,
 					  const struct drm_encoder_helper_funcs *funcs)
 {
-	encoder->helper_private = (void *)funcs;
+	encoder->helper_private = funcs;
 }
 
 static inline void drm_connector_helper_add(struct drm_connector *connector,
 					    const struct drm_connector_helper_funcs *funcs)
 {
-	connector->helper_private = (void *)funcs;
+	connector->helper_private = funcs;
 }
 
 extern void drm_helper_resume_force_mode(struct drm_device *dev);
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h
index e48157a5a59c..96e16283afb9 100644
--- a/include/drm/drm_plane_helper.h
+++ b/include/drm/drm_plane_helper.h
@@ -76,7 +76,7 @@ struct drm_plane_helper_funcs {
 static inline void drm_plane_helper_add(struct drm_plane *plane,
 					const struct drm_plane_helper_funcs *funcs)
 {
-	plane->helper_private = (void *)funcs;
+	plane->helper_private = funcs;
 }
 
 extern int drm_plane_helper_check_update(struct drm_plane *plane,
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer
  2015-04-13  8:21 ` [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer Jani Nikula
@ 2015-04-13  8:25   ` Jani Nikula
  0 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2015-04-13  8:25 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig

On Mon, 13 Apr 2015, Jani Nikula <jani.nikula@intel.com> wrote:
> They're only used to store const pointers anyway. This helps to keep
> Ville and the compiler happy.
>
> Christian König <christian.koenig@amd.com>

Copy-paste fail, please s/^/Reviewed-by: / while merging.

Jani.

> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  include/drm/drm_crtc.h         | 8 ++++----
>  include/drm/drm_crtc_helper.h  | 6 +++---
>  include/drm/drm_plane_helper.h | 2 +-
>  3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 150b93c29150..d4e4b82da3ad 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -466,7 +466,7 @@ struct drm_crtc {
>  	int framedur_ns, linedur_ns, pixeldur_ns;
>  
>  	/* if you are using the helper */
> -	void *helper_private;
> +	const void *helper_private;
>  
>  	struct drm_object_properties properties;
>  
> @@ -596,7 +596,7 @@ struct drm_encoder {
>  	struct drm_crtc *crtc;
>  	struct drm_bridge *bridge;
>  	const struct drm_encoder_funcs *funcs;
> -	void *helper_private;
> +	const void *helper_private;
>  };
>  
>  /* should we poll this connector for connects and disconnects */
> @@ -700,7 +700,7 @@ struct drm_connector {
>  	/* requested DPMS state */
>  	int dpms;
>  
> -	void *helper_private;
> +	const void *helper_private;
>  
>  	/* forced on connector */
>  	struct drm_cmdline_mode cmdline_mode;
> @@ -863,7 +863,7 @@ struct drm_plane {
>  
>  	enum drm_plane_type type;
>  
> -	void *helper_private;
> +	const void *helper_private;
>  
>  	struct drm_plane_state *state;
>  };
> diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
> index 92d5135b55d2..c8fc187061de 100644
> --- a/include/drm/drm_crtc_helper.h
> +++ b/include/drm/drm_crtc_helper.h
> @@ -197,19 +197,19 @@ extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
>  static inline void drm_crtc_helper_add(struct drm_crtc *crtc,
>  				       const struct drm_crtc_helper_funcs *funcs)
>  {
> -	crtc->helper_private = (void *)funcs;
> +	crtc->helper_private = funcs;
>  }
>  
>  static inline void drm_encoder_helper_add(struct drm_encoder *encoder,
>  					  const struct drm_encoder_helper_funcs *funcs)
>  {
> -	encoder->helper_private = (void *)funcs;
> +	encoder->helper_private = funcs;
>  }
>  
>  static inline void drm_connector_helper_add(struct drm_connector *connector,
>  					    const struct drm_connector_helper_funcs *funcs)
>  {
> -	connector->helper_private = (void *)funcs;
> +	connector->helper_private = funcs;
>  }
>  
>  extern void drm_helper_resume_force_mode(struct drm_device *dev);
> diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h
> index e48157a5a59c..96e16283afb9 100644
> --- a/include/drm/drm_plane_helper.h
> +++ b/include/drm/drm_plane_helper.h
> @@ -76,7 +76,7 @@ struct drm_plane_helper_funcs {
>  static inline void drm_plane_helper_add(struct drm_plane *plane,
>  					const struct drm_plane_helper_funcs *funcs)
>  {
> -	plane->helper_private = (void *)funcs;
> +	plane->helper_private = funcs;
>  }
>  
>  extern int drm_plane_helper_check_update(struct drm_plane *plane,
> -- 
> 2.1.4
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers
  2015-04-13  8:21 [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Jani Nikula
  2015-04-13  8:21 ` [PATCH 2/3] drm/armada: constify struct drm_encoder_helper_funcs pointer Jani Nikula
  2015-04-13  8:21 ` [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer Jani Nikula
@ 2015-04-13  8:28 ` Christian König
  2 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2015-04-13  8:28 UTC (permalink / raw)
  To: Jani Nikula, dri-devel

On 13.04.2015 10:21, Jani Nikula wrote:
> Some non-const pointers were added since the last constification, fix
> them.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

For this one Reviewed-by: Christian König <christian.koenig@amd.com>.

Can't say anything for patch #2, and #3 already has my rb IIRC.

Regards,
Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++--
>   drivers/gpu/drm/radeon/radeon_dp_mst.c     | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index f150c2495fa4..cebb65e07e1d 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -751,7 +751,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct
>   		if (connector->encoder)
>   			radeon_encoder = to_radeon_encoder(connector->encoder);
>   		else {
> -			struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
> +			const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;
>   			radeon_encoder = to_radeon_encoder(connector_funcs->best_encoder(connector));
>   		}
>   
> @@ -762,7 +762,7 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct
>   
>   		if (connector->encoder->crtc) {
>   			struct drm_crtc *crtc  = connector->encoder->crtc;
> -			struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
> +			const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
>   			struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
>   
>   			radeon_crtc->output_csc = radeon_encoder->output_csc;
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index 5952ff2bb647..1017338a49d9 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -604,7 +604,7 @@ radeon_dp_create_fake_mst_encoder(struct radeon_connector *connector)
>   	struct radeon_encoder *radeon_encoder;
>   	struct radeon_encoder_mst *mst_enc;
>   	struct drm_encoder *encoder;
> -	struct drm_connector_helper_funcs *connector_funcs = connector->base.helper_private;
> +	const struct drm_connector_helper_funcs *connector_funcs = connector->base.helper_private;
>   	struct drm_encoder *enc_master = connector_funcs->best_encoder(&connector->base);
>   
>   	DRM_DEBUG_KMS("enc master is %p\n", enc_master);

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-13  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13  8:21 [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Jani Nikula
2015-04-13  8:21 ` [PATCH 2/3] drm/armada: constify struct drm_encoder_helper_funcs pointer Jani Nikula
2015-04-13  8:21 ` [PATCH 3/3] drm: make crtc/encoder/connector/plane helper_private a const pointer Jani Nikula
2015-04-13  8:25   ` Jani Nikula
2015-04-13  8:28 ` [PATCH 1/3] drm/radeon: constify more struct drm_*_helper funcs pointers Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.