mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Sascha Hauer" <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re[2]: [RFC 1/3] clk: Remove unneded private "parent" fields
Date: Fri, 15 Mar 2013 12:48:18 +0400	[thread overview]
Message-ID: <1363337298.224316052@f383.i.mail.ru> (raw)
In-Reply-To: <20130315082927.GC1906@pengutronix.de>

> On Fri, Mar 15, 2013 at 10:35:38AM +0400, Alexander Shiyan wrote:
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> >  drivers/clk/clk-divider-table.c |    4 +---
> >  drivers/clk/clk-divider.c       |    4 +---
> >  drivers/clk/clk-fixed-factor.c  |    4 +---
> >  drivers/clk/clk-gate.c          |    4 +---
> >  4 files changed, 4 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/clk/clk-divider-table.c b/drivers/clk/clk-divider-table.c
> > index 204e24d..e75fb78 100644
> > --- a/drivers/clk/clk-divider-table.c
> > +++ b/drivers/clk/clk-divider-table.c
> > @@ -25,7 +25,6 @@ struct clk_divider_table {
> >  	u8 shift;
> >  	u8 width;
> >  	void __iomem *reg;
> > -	const char *parent;
> >  	const struct clk_div_table *table;
> >  	int table_size;
> >  	int max_div_index;
> > @@ -94,10 +93,9 @@ struct clk *clk_divider_table(const char *name,
> >  	div->shift = shift;
> >  	div->reg = reg;
> >  	div->width = width;
> > -	div->parent = parent;
> >  	div->clk.ops = &clk_divider_table_ops;
> >  	div->clk.name = name;
> > -	div->clk.parent_names = &div->parent;
> > +	div->clk.parent_names = &parent;
> 
> You can't do that. You can assume that the string *name points to stays
> valid, but the pointer itself might not stay valid when leaving this
> function. parent_names is an array of pointers, with the divider it only
> has one entry, but still you need to keep a pointer for it. This is what
> div->parent is for.

You are right. Thanks.

---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2013-03-15  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15  6:35 Alexander Shiyan
2013-03-15  6:35 ` [RFC 2/3] clk: Using the "is_enabled" to determine the clock state Alexander Shiyan
2013-03-15  8:52   ` Sascha Hauer
2013-03-15  6:35 ` [RFC 3/3] clk: Add "is_enabled" callback for gated clocks Alexander Shiyan
2013-03-15  8:29 ` [RFC 1/3] clk: Remove unneded private "parent" fields Sascha Hauer
2013-03-15  8:48   ` Alexander Shiyan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363337298.224316052@f383.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox