From: Cho KyongHo <pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Sachin Kamat <sachin.kamat-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Linux DeviceTree
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linux Samsung SOC
<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Prathyush <prathyush.k-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Grant Grundler <grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Linux Kernel
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linux IOMMU
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Sylwester Nawrocki
<s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Antonios Motakis
<a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>,
Linux ARM Kernel
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Rahul Sharma
<rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v11 15/27] iommu/exynos: use convenient macro to handle gate clocks
Date: Tue, 18 Mar 2014 20:03:29 +0900 [thread overview]
Message-ID: <20140318200329.cc1dca7541b4b1916e5d9d48@samsung.com> (raw)
In-Reply-To: <CAK9yfHx_=Os1G46nNO1HDA3tigkRNeHKN1KGCvuN=w7dRTkfjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, 14 Mar 2014 22:27:59 +0530, Sachin Kamat wrote:
> Hi KyongHo,
>
> On 14 March 2014 19:13, Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> > Hi KyongHo,
> >
> >
> > On 14.03.2014 06:09, Cho KyongHo wrote:
> >>
> >> exynos-iommu driver must care about master H/W's gate clock as well as
> >> System MMU's gate clock. To enhance readability of the source code,
> >> macros to gate/ungate those clocks are defined.
> >>
> >> Signed-off-by: Cho KyongHo <pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> >> ---
> >> drivers/iommu/exynos-iommu.c | 34 ++++++++++++++++++++++------------
> >> 1 file changed, 22 insertions(+), 12 deletions(-)
> >>
> >> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> >> index 71e77f1..cef62d0 100644
> >> --- a/drivers/iommu/exynos-iommu.c
> >> +++ b/drivers/iommu/exynos-iommu.c
> >> @@ -101,6 +101,16 @@
> >> #define REG_PB1_SADDR 0x054
> >> #define REG_PB1_EADDR 0x058
> >>
> >> +#define __clk_gate_ctrl(data, clk, en) do { \
> >> + if (data->clk) \
> >> + clk_##en##able(data->clk); \
> >> + } while (0)
> >> +
> >> +#define __sysmmu_clk_enable(data) __clk_gate_ctrl(data, clk, en)
> >> +#define __sysmmu_clk_disable(data) __clk_gate_ctrl(data, clk, dis)
> >> +#define __master_clk_enable(data) __clk_gate_ctrl(data, clk_master,
> >> en)
> >> +#define __master_clk_disable(data) __clk_gate_ctrl(data, clk_master,
> >> dis)
> >> +
> >
> >
> > I'd say that such macros only obfuscate code, without any gains, as you can
> > see in diffstat - this patch adds more lines than it removes.
> >
> > Please drop this change.
>
> I agree with Tomasz here.
>
Are you concerning about using macros or more insertions than deletions?
The deletions in this patch are only clk_enable() and clk_disable()
but they must be
"if (!IS_ERR(clk)) clk_enable(clk)" and "if (!IS_ERR(clk)) clk_disable(clk)".
I think use of macro is fancier in that case.
Thank you.
KyongHo.
next prev parent reply other threads:[~2014-03-18 11:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 5:09 [PATCH v11 15/27] iommu/exynos: use convenient macro to handle gate clocks Cho KyongHo
2014-03-14 13:43 ` Tomasz Figa
[not found] ` <5323078E.4060903-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-14 16:57 ` Sachin Kamat
[not found] ` <CAK9yfHx_=Os1G46nNO1HDA3tigkRNeHKN1KGCvuN=w7dRTkfjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-18 11:03 ` Cho KyongHo [this message]
[not found] ` <20140318200329.cc1dca7541b4b1916e5d9d48-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-18 11:18 ` Sachin Kamat
[not found] ` <CAK9yfHxcArgmxm4wSipY1afjmG00zugyycdU+BQbuexvL2bmBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-18 13:07 ` Tomasz Figa
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=20140318200329.cc1dca7541b4b1916e5d9d48@samsung.com \
--to=pullip.cho-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=prathyush.k-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=sachin.kamat-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
/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