clk: constify parent name arrays in macros
PATCH 1/1 clk: constify parent name arrays in macros
parent name array is now expected to be const char *, make the relevent changes in the clk macros which define default clock types.
--- include/linux/clk-private.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
include/linux/clk-private.h +3 -3
@@ -70,7 +70,7 @@ struct clk {#define DEFINE_CLK_FIXED_RATE (_name, _flags, _rate, \ _fixed_rate_flags) \ static struct clk _name; \ - static char *_name##_parent_names[] = {}; \ + static const char *_name##_parent_names[] = {}; \ static struct clk_fixed_rate _name##_hw = { \ .hw = { \ .clk = &_name, \
@@ -85,7 +85,7 @@ struct clk { _flags, _reg, _bit_idx, \ _gate_flags, _lock) \static struct clk _name; \ - static char *_name##_parent_names[] = { \ + static const char *_name##_parent_names[] = { \ _parent_name, \ }; \ static struct clk *_name##_parents[] = { \
@@ -107,7 +107,7 @@ struct clk { _flags, _reg, _shift, _width, \ _divider_flags, _lock) \static struct clk _name; \ - static char *_name##_parent_names[] = { \ + static const char *_name##_parent_names[] = { \ _parent_name, \ }; \ static struct clk *_name##_parents[] = { \
Signature · 1 line
1.7.1
Quoted 5 lines · Rajendra Nayak
parent name array is now expected to be const char *, make the relevent changes in the clk macros which define default clock types.
Signed-off-by Rajendra Nayak <[email protected]>
Good catch Rajendra. I'll pull it into clk-next.
Regards,
Mike
Quoted 38 lines
---
?include/linux/clk-private.h | ? ?6 +++---
?1 files changed, 3 insertions(+), 3 deletions(-)include/linux/clk-private.h +3
-4@@ -70,7 +70,7 @@ struct clk { ?#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, ? ? ? ? ? ?\ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_fixed_rate_flags) ? ? ? ? ? ? ?\ ? ? ? ?static struct clk _name; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ - ? ? ? static char *_name##_parent_names[] = {}; ? ? ? ? ? ? ? \ + ? ? ? static const char *_name##_parent_names[] = {}; ? ? ? ? \ ? ? ? ?static struct clk_fixed_rate _name##_hw = { ? ? ? ? ? ? \ ? ? ? ? ? ? ? ?.hw = { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ ? ? ? ? ? ? ? ? ? ? ? ?.clk = &_name, ? ? ? ? ? ? ? ? ? ? ? ? ?\@@ -85,7 +85,7 @@ struct clk { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_flags, _reg, _bit_idx, ? ? ? ? \ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_gate_flags, _lock) ? ? ? ? ? ? \ ? ? ? ?static struct clk _name; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ - ? ? ? static char *_name##_parent_names[] = { ? ? ? ? ? ? ? ? \ + ? ? ? static const char *_name##_parent_names[] = { ? ? ? ? ? \ ? ? ? ? ? ? ? ?_parent_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ ? ? ? ?}; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ ? ? ? ?static struct clk *_name##_parents[] = { ? ? ? ? ? ? ? ?\@@ -107,7 +107,7 @@ struct clk { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_flags, _reg, _shift, _width, ? \ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_divider_flags, _lock) ? ? ? ? ?\ ? ? ? ?static struct clk _name; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ - ? ? ? static char *_name##_parent_names[] = { ? ? ? ? ? ? ? ? \ + ? ? ? static const char *_name##_parent_names[] = { ? ? ? ? ? \ ? ? ? ? ? ? ? ?_parent_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ ? ? ? ?}; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ ? ? ? ?static struct clk *_name##_parents[] = { ? ? ? ? ? ? ? ?\ --1.7.1
Quoted 16 lines · Mike
Quoted 5 lines · Rajendra Nayak
parent name array is now expected to be const char *, make the relevent changes in the clk macros which define default clock types.
Signed-off-by Rajendra Nayak <[email protected]>Good catch Rajendra. I'll pull it into clk-next.
Regards,
MikeQuoted 4 lines
---
?include/linux/clk-private.h | ? ?6 +++---
?1 files changed, 3 insertions(+), 3 deletions(-)
Quoted 10 lines
include/linux/clk-private.h struct clk { · line 73
Quoted 10 lines
include/linux/clk-private.h +1
-1@@ -70,7 +70,7 @@ struct clk { ?#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, ? ? ? ? ? ?\ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_fixed_rate_flags) ? ? ? ? ? ? ?\ ? ? ? ?static struct clk _name; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ - ? ? ? static char *_name##_parent_names[] = {}; ? ? ? ? ? ? ? \ + ? ? ? static const char *_name##_parent_names[] = {}; ? ? ? ? \
does it make sense to have this as:
static const char * const _name##_parent_names[] = { }; ??
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120427/396c5483/attachment.sig>
Quoted 30 lines · Felipe Balbi
Quoted 16 lines · Mike
Quoted 5 lines · Rajendra Nayak
parent name array is now expected to be const char *, make the relevent changes in the clk macros which define default clock types.
Signed-off-by Rajendra Nayak <[email protected]>Good catch Rajendra. ?I'll pull it into clk-next.
Regards,
MikeQuoted 4 lines
---
?include/linux/clk-private.h | ? ?6 +++---
?1 files changed, 3 insertions(+), 3 deletions(-)Quoted 10 lines
include/linux/clk-private.h struct clk { · line 73
Quoted 10 lines
include/linux/clk-private.h +1
-1@@ -70,7 +70,7 @@ struct clk { ?#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, ? ? ? ? ? ?\ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_fixed_rate_flags) ? ? ? ? ? ? ?\ ? ? ? ?static struct clk _name; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ - ? ? ? static char *_name##_parent_names[] = {}; ? ? ? ? ? ? ? \ + ? ? ? static const char *_name##_parent_names[] = {}; ? ? ? ? \does it make sense to have this as:
Quoted 1 line
static const char * const _name##_parent_names[] = { }; ??
Hi Felipe,
I don't think so. We're never going to reference the member of the array anyways, so I think the current approach is fine for just satisfying type qualifier-sameness.
Thanks,
Mike