Linux clock framework development
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@samsung.com>
To: Yadwinder Singh Brar <yadi.brar01@gmail.com>
Cc: linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Sangbeom Kim <sbkim73@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-clk@vger.kernel.org, Andi Shyti <andi@etezian.org>
Subject: Re: [PATCH 2/2] clk: s2mps11: allocate only one structure for clock init
Date: Tue, 19 Jan 2016 11:43:16 +0900	[thread overview]
Message-ID: <20160119024316.GA3793@samsunx.samsung> (raw)
In-Reply-To: <CAKew6eX4WZa4595ZUhiX+Ndc_WCzBNJBh5ejzxaJVkCnAskCYw@mail.gmail.com>

Hi Yadwinder,

>     The driver allocates three structures for three different clock
>     types. They are quite similar and in the clock init data they
>     differ only by the name. Only one of these structure is used,
>     while the others lie unused in the memory.
> 
> 
> If you are worried about memory, they can be made __initdata by
> creating a copy during probe.

mmmhhh... allocating in boot time as much as we want and then copy
what we need? It doesn't look that pretty to me.

>     The clock's name, though, is not such a meaningful information
> 
> 
> I think it can be meaningful in debugging.

Can you explain what's the use of the naming other than
debugging?

>     and by assigning the same name to the initial data we can avoid
>     over allocation. The common name chosen will be s2mps11,
>     coherently with the device driver name, instead of the clock
>     device.
> 
>     Therefore, remove the structures associated to s2mps13 and
>     s2mps14 and use only the one referred to s2mps11 for all kind of
>     clocks.
> 
> 
> IMHO, with all these modifications, it will leave driver with some extra
> checks and reduced readability, perhaps will make it complex to add
> support for similar clocks but with different clk_ops, if next version or
>  any similar mfd chip comes up in future.

In that case, when the new chip will come, we would need to
figure out something, but for sure I don't see it as a good idea
to leave allocated unused structures.

Thanks,
Andi

  parent reply	other threads:[~2016-01-19  2:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  8:25 [PATCH 0/2] s2mps11 code refactoring Andi Shyti
2016-01-18  8:25 ` [PATCH 1/2] clk: s2mps11: remove redundant variable Andi Shyti
2016-01-18 23:34   ` Krzysztof Kozlowski
2016-01-18  8:25 ` [PATCH 2/2] clk: s2mps11: allocate only one structure for clock init Andi Shyti
2016-01-18 23:44   ` Krzysztof Kozlowski
2016-01-19  0:42   ` Yadwinder Singh Brar
2016-01-19  0:48     ` Krzysztof Kozlowski
2016-01-19  1:11       ` Yadwinder Singh Brar
2016-01-19  2:43     ` Andi Shyti [this message]
2016-01-19  8:00       ` Yadwinder Singh Brar

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=20160119024316.GA3793@samsunx.samsung \
    --to=andi.shyti@samsung.com \
    --cc=andi@etezian.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sbkim73@samsung.com \
    --cc=sboyd@codeaurora.org \
    --cc=yadi.brar01@gmail.com \
    /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