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: <1438056355.17770.9.camel@mtksdaap41>
Date:	Tue, 28 Jul 2015 12:05:55 +0800
From:	James Liao <jamesjj.liao@...iatek.com>
To:	Daniel Kurtz <djkurtz@...omium.org>
CC:	Matthias Brugger <matthias.bgg@...il.com>,
	Mike Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...eaurora.org>,
	"Heiko Stubner" <heiko@...ech.de>,
	srv_heupstream <srv_heupstream@...iatek.com>,
	Ricky Liang <jcliang@...omium.org>,
	Rob Herring <robh+dt@...nel.org>,
	Sascha Hauer <kernel@...gutronix.de>,
	"open list:OPEN FIRMWARE AND..." <devicetree@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v4 6/7] clk: mediatek: Add USB clock support in MT8173
 APMIXEDSYS

Hi Daniel,

On Fri, 2015-07-24 at 19:28 +0800, Daniel Kurtz wrote:
> On Fri, Jul 24, 2015 at 11:02 AM, James Liao <jamesjj.liao@...iatek.com> wrote:
> > +struct clk *mtk_clk_register_ref2usb_tx(const char *name,
> > +                       const char *parent_name, void __iomem *reg)
> 
> struct clk * __init mtk_clk_register_ref2usb_tx(

It will be added in next patch.

> >
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> > -#include <linux/slab.h>
> > -#include <linux/mfd/syscon.h>
> 
> nit: this looks like an unrelated change that can be in its own patch.

It will be in a separated patch.

> >
> > +typedef struct clk *(*mtk_clk_register_ex)(const char *, const char *,
> > +                                       void __iomem *);
> > +
> > +struct mtk_clk_ex {
> > +       int id;
> > +       const char *name;
> > +       const char *parent;
> > +       u32 reg_ofs;
> > +       mtk_clk_register_ex reg_clk_ex;
> 
> 
> This "mtk_clk_ex" abstraction seems unnecessarily complicated for a
> one-off USB clock.
> Just call mtk_clk_register_ref2usb_tx() directly from mtk_apmixedsys_init().

Use a table to associate related constants and names is more readable,
such as:

  APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", ... 

If we call mtk_clk_register_ref2usb_tx() directly, it will be:

  clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", ...);
  clk_data-clks[CLK_APMIXED_REF2USB_TX] = clk;

Do you prefer the last one?


Best regards,

James

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