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]
Date:	Fri, 25 Jan 2013 18:23:46 +0200
From:	Felipe Balbi <balbi@...com>
To:	Mark Rutland <mark.rutland@....com>
CC:	Felipe Balbi <balbi@...com>,
	Kishon Vijay Abraham I <kishon@...com>,
	"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
	"rob@...dley.net" <rob@...dley.net>,
	"tony@...mide.com" <tony@...mide.com>,
	"b-cousson@...com" <b-cousson@...com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux@....linux.org.uk" <linux@....linux.org.uk>
Subject: Re: [PATCH v4 1/4] drivers: usb: phy: add a new driver for usb part
 of control module

Hi,

On Fri, Jan 25, 2013 at 04:14:02PM +0000, Mark Rutland wrote:
> On Fri, Jan 25, 2013 at 02:59:28PM +0000, Felipe Balbi wrote:
> > Hi,
> > 
> > On Fri, Jan 25, 2013 at 12:29:43PM +0000, Mark Rutland wrote:
> > > > > > +   depending upon omap4 or omap5.
> > > > > > + - reg-names: The names of the register addresses corresponding to the registers
> > > > > > +   filled in "reg".
> > > > > > + - ti,type: This is used to differentiate whether the control module has
> > > > > > +   usb mailbox or usb3 phy power. omap4 has usb mailbox in control module to
> > > > > > +   notify events to the musb core and omap5 has usb3 phy power register to
> > > > > > +   power on usb3 phy. Should be "1" if it has mailbox and "2" if it has usb3
> > > > > > +   phy power.
> > > > > 
> > > > > Why not make this a string property, perhaps values "mailbox" or "register"?
> > > > 
> > > > NAK.
> > > 
> > > Can I ask what your objection to using a string property is?
> > > 
> > > As far as I can see, "ti,type" is only used by this driver, so there's no
> > > common convention to stick to. Using a string makes the binding easier for
> > > humans to read, and thus harder to mess up in a dts, and it decouples the
> > > binding from kernel-side constants.
> > 
> > IIRC there is some work going on to add #define-like support for DT,
> > which would allow us to match against integers while still having
> > meaningful symbolic representations.
> 
> I was under the impression that the motivation for using the preprocessor on
> the DT was to allow symbolic names for device/soc-specific values like
> addresses, rather than what amounts to ABI values for the binding.
> 
> I don't see the point in building a binding that depends on future
> functionality to be legible, especially as we can make it more readable,
> robust, and just as extensible today, with a simple change to the proposed
> binding.
> 
> Even ignoring the above, the driver isn't doing appropriate sanity checking.
> If you use a string property, this sanity check is implicit in the parsing --
> you've either matched a value you can handle or you haven't.

Even IRQs use numbers (not talking about the IRQ number, but the IRQ
flags), why would we depend on string comparisson ? It doesn't make
sense.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists