lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20140318200329.cc1dca7541b4b1916e5d9d48@samsung.com>
Date:	Tue, 18 Mar 2014 20:03:29 +0900
From:	Cho KyongHo <pullip.cho@...sung.com>
To:	Sachin Kamat <sachin.kamat@...aro.org>
Cc:	Tomasz Figa <t.figa@...sung.com>,
	Linux ARM Kernel <linux-arm-kernel@...ts.infradead.org>,
	Linux DeviceTree <devicetree@...r.kernel.org>,
	Linux IOMMU <iommu@...ts.linux-foundation.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Linux Samsung SOC <linux-samsung-soc@...r.kernel.org>,
	Antonios Motakis <a.motakis@...tualopensystems.com>,
	Grant Grundler <grundler@...omium.org>,
	Joerg Roedel <joro@...tes.org>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Prathyush <prathyush.k@...sung.com>,
	Rahul Sharma <rahul.sharma@...sung.com>,
	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Varun Sethi <Varun.Sethi@...escale.com>
Subject: Re: [PATCH v11 15/27] iommu/exynos: use convenient macro to handle
 gate clocks

On Fri, 14 Mar 2014 22:27:59 +0530, Sachin Kamat wrote:
>  Hi KyongHo,
> 
> On 14 March 2014 19:13, Tomasz Figa <t.figa@...sung.com> 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@...sung.com>
> >> ---
> >>   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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ