diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-23 09:13:42 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-08-26 12:52:12 +0200 |
commit | 546c5a9c788eb63f3e3a0ed74f6498cc19c2b07d (patch) | |
tree | 20912085e85bf288198c375eb3d5bdc6bb6a87e3 | |
parent | f38ba32965c5686c062884fab2e9f505015af82a (diff) | |
download | barebox-546c5a9c788eb63f3e3a0ed74f6498cc19c2b07d.tar.gz barebox-546c5a9c788eb63f3e3a0ed74f6498cc19c2b07d.tar.xz |
param_enum: Make name strings const
Not only the array containing the pointers should be const but
also the strings themselves, so instead of using const char **
use const char * const *.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | include/globalvar.h | 4 | ||||
-rw-r--r-- | include/param.h | 4 | ||||
-rw-r--r-- | lib/parameter.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/globalvar.h b/include/globalvar.h index 6e10956b89..e77209bd79 100644 --- a/include/globalvar.h +++ b/include/globalvar.h @@ -60,7 +60,7 @@ static inline int globalvar_add_simple_bool(const char *name, } static inline int globalvar_add_simple_enum(const char *name, - int *value, const char **names, int max) + int *value, const char * const *names, int max) { struct param_d *p; @@ -117,7 +117,7 @@ static inline int globalvar_add_simple_bool(const char *name, } static inline int globalvar_add_simple_enum(const char *name, - int *value, const char **names, int max) + int *value, const char * const *names, int max) { return 0; } diff --git a/include/param.h b/include/param.h index 3a851fc552..3fb4740b3a 100644 --- a/include/param.h +++ b/include/param.h @@ -50,7 +50,7 @@ struct param_d *dev_add_param_bool(struct device_d *dev, const char *name, struct param_d *dev_add_param_enum(struct device_d *dev, const char *name, int (*set)(struct param_d *p, void *priv), int (*get)(struct param_d *p, void *priv), - int *value, const char **names, int max, void *priv); + int *value, const char * const *names, int max, void *priv); struct param_d *dev_add_param_int_ro(struct device_d *dev, const char *name, int value, const char *format); @@ -120,7 +120,7 @@ static inline struct param_d *dev_add_param_int(struct device_d *dev, const char static inline struct param_d *dev_add_param_enum(struct device_d *dev, const char *name, int (*set)(struct param_d *p, void *priv), int (*get)(struct param_d *p, void *priv), - int *value, const char **names, int max, void *priv) + int *value, const char * const *names, int max, void *priv) { return ERR_PTR(-ENOSYS); diff --git a/lib/parameter.c b/lib/parameter.c index b23885958b..868b810019 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -390,7 +390,7 @@ struct param_d *dev_add_param_int(struct device_d *dev, const char *name, struct param_enum { struct param_d param; int *value; - const char **names; + const char * const *names; int num_names; int (*set)(struct param_d *p, void *priv); int (*get)(struct param_d *p, void *priv); @@ -467,7 +467,7 @@ static void param_enum_info(struct param_d *p) struct param_d *dev_add_param_enum(struct device_d *dev, const char *name, int (*set)(struct param_d *p, void *priv), int (*get)(struct param_d *p, void *priv), - int *value, const char **names, int num_names, void *priv) + int *value, const char * const *names, int num_names, void *priv) { struct param_enum *pe; struct param_d *p; |