linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: constify parent name arrays in macros
@ 2012-04-27 12:28 Rajendra Nayak
  2012-04-27 17:55 ` Turquette, Mike
  0 siblings, 1 reply; 4+ messages in thread
From: Rajendra Nayak @ 2012-04-27 12:28 UTC (permalink / raw)
  To: linux-arm-kernel

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 <rnayak@ti.com>
---
 include/linux/clk-private.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index eeae7a3..6ebec83 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -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

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

* [PATCH] clk: constify parent name arrays in macros
  2012-04-27 12:28 [PATCH] clk: constify parent name arrays in macros Rajendra Nayak
@ 2012-04-27 17:55 ` Turquette, Mike
  2012-04-27 18:18   ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Turquette, Mike @ 2012-04-27 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 27, 2012 at 5:28 AM, Rajendra Nayak <rnayak@ti.com> wrote:
> 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 <rnayak@ti.com>

Good catch Rajendra.  I'll pull it into clk-next.

Regards,
Mike

> ---
> ?include/linux/clk-private.h | ? ?6 +++---
> ?1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
> index eeae7a3..6ebec83 100644
> --- a/include/linux/clk-private.h
> +++ b/include/linux/clk-private.h
> @@ -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
>

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

* [PATCH] clk: constify parent name arrays in macros
  2012-04-27 17:55 ` Turquette, Mike
@ 2012-04-27 18:18   ` Felipe Balbi
  2012-05-01 22:18     ` Turquette, Mike
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2012-04-27 18:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 27, 2012 at 10:55:50AM -0700, Turquette, Mike wrote:
> On Fri, Apr 27, 2012 at 5:28 AM, Rajendra Nayak <rnayak@ti.com> wrote:
> > 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 <rnayak@ti.com>
> 
> Good catch Rajendra.  I'll pull it into clk-next.
> 
> Regards,
> Mike
> 
> > ---
> > ?include/linux/clk-private.h | ? ?6 +++---
> > ?1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
> > index eeae7a3..6ebec83 100644
> > --- a/include/linux/clk-private.h
> > +++ b/include/linux/clk-private.h
> > @@ -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[] = { }; ??

-- 
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>

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

* [PATCH] clk: constify parent name arrays in macros
  2012-04-27 18:18   ` Felipe Balbi
@ 2012-05-01 22:18     ` Turquette, Mike
  0 siblings, 0 replies; 4+ messages in thread
From: Turquette, Mike @ 2012-05-01 22:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 27, 2012 at 11:18 AM, Felipe Balbi <balbi@ti.com> wrote:
> On Fri, Apr 27, 2012 at 10:55:50AM -0700, Turquette, Mike wrote:
>> On Fri, Apr 27, 2012 at 5:28 AM, Rajendra Nayak <rnayak@ti.com> wrote:
>> > 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 <rnayak@ti.com>
>>
>> Good catch Rajendra. ?I'll pull it into clk-next.
>>
>> Regards,
>> Mike
>>
>> > ---
>> > ?include/linux/clk-private.h | ? ?6 +++---
>> > ?1 files changed, 3 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
>> > index eeae7a3..6ebec83 100644
>> > --- a/include/linux/clk-private.h
>> > +++ b/include/linux/clk-private.h
>> > @@ -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[] = { }; ??

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

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

end of thread, other threads:[~2012-05-01 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27 12:28 [PATCH] clk: constify parent name arrays in macros Rajendra Nayak
2012-04-27 17:55 ` Turquette, Mike
2012-04-27 18:18   ` Felipe Balbi
2012-05-01 22:18     ` Turquette, Mike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).