diff mbox

[v5,1/2] drm: Add const to name field declaration in struct drm_prop_enum_list

Message ID 5dd3b6a1e20452bd8abdcbc55d1e8d7f56262266.1496161066.git.jsarha@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jyri Sarha May 30, 2017, 4:29 p.m. UTC
There is no reason why the name field should not be const, but
several why it should. The struct should only be used by
drm_property_create_enum() and there the name-field from the struct
is passed to drm_property_add_enum(), which takes a const char * as
a parameter.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 include/drm/drm_property.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä June 8, 2017, 8:36 p.m. UTC | #1
On Tue, May 30, 2017 at 07:29:55PM +0300, Jyri Sarha wrote:
> There is no reason why the name field should not be const, but
> several why it should. The struct should only be used by
> drm_property_create_enum() and there the name-field from the struct
> is passed to drm_property_add_enum(), which takes a const char * as
> a parameter.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>

Thanks for the patch. I've pushed this to drm-misc-next.

> ---
>  include/drm/drm_property.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
> index 13e8c17..619868dc 100644
> --- a/include/drm/drm_property.h
> +++ b/include/drm/drm_property.h
> @@ -214,7 +214,7 @@ struct drm_property_blob {
>  
>  struct drm_prop_enum_list {
>  	int type;
> -	char *name;
> +	const char *name;
>  };
>  
>  #define obj_to_property(x) container_of(x, struct drm_property, base)
> -- 
> 1.9.1
diff mbox

Patch

diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
index 13e8c17..619868dc 100644
--- a/include/drm/drm_property.h
+++ b/include/drm/drm_property.h
@@ -214,7 +214,7 @@  struct drm_property_blob {
 
 struct drm_prop_enum_list {
 	int type;
-	char *name;
+	const char *name;
 };
 
 #define obj_to_property(x) container_of(x, struct drm_property, base)