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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1409918522.30155.89.camel@intel.com>
Date:	Fri, 5 Sep 2014 12:02:01 +0000
From:	"Shevchenko, Andriy" <andriy.shevchenko@...el.com>
To:	"Chen, Alvin" <alvin.chen@...el.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	"Kweh, Hock Leong" <hock.leong.kweh@...el.com>,
	"sebastian@...akpoint.cc" <sebastian@...akpoint.cc>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"Ong, Boon Leong" <boon.leong.ong@...el.com>,
	"gnurou@...il.com" <gnurou@...il.com>,
	"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"grant.likely@...aro.org" <grant.likely@...aro.org>,
	"Westerberg, Mika" <mika.westerberg@...el.com>,
	"dvhart@...ux.intel.com" <dvhart@...ux.intel.com>,
	"atull@...nsource.altera.com" <atull@...nsource.altera.com>
Subject: Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding
 to MFD driver

On Fri, 2014-09-05 at 10:20 +0000, Chen, Alvin wrote:
> > > -	port->bgc.gc.ngpio = ngpio;
> > > -	port->bgc.gc.of_node = port_np;
> > > +#ifdef CONFIG_OF_GPIO
> > 
> > Do we really need this #ifdef ?
> > of_node will be NULL anyway, or I missed something?
> Yes, otherwise, can't compile it. Please refer 'struct gpio_chip', 'gc.of_node' is in OF_GPIO micro also.

Ah, okay. Thus, it depends to Linus opinion, since I, for example, would
like to see this field present in the structure independently of
OF_GPIO.

> 
> > > +	if (pp->irq)
> > 
> > irq == 0 is a valid hwirq (hardware irq) number. Yes, there is unlikely we have it
> > somewhere, but still it's possible. And yes, IRQ framework doesn't work with
> > virq == 0 (*virtual* irq), but accepts hwirq == 0. I recommend to use int type for
> > irq line number, and recognize negative value (usually -1) as no irq needed /
> > found.
> Understand. But if you refer the original code, you can see:
> irq = irq_of_parse_and_map(node, 0);
> If (!irq) {
> ......
> return;
> }
> From above code, if irq=0, it indicates irq is not supported for OF devices. If we use '-1' to indicate irq is not supported. To make OF work, then our code should be:

Yes, like I said above. You introduce hw irq in the pdata, which could
be 0.


> irq = irq_of_parse_and_map(node, 0);
> If (!irq) {
> pp->irq = -1;
> return;
> } else {
> pp->irq = irq;
> }
> Then the code looks strange.
> 
> How do you think?

If I understood correctly you messed up with hwirq vs. virq.
Otherwise you have mention that you are using virq everywhere (I guess
you may rename the field in the structure), but in this case the field
in the platform_data looks a bit strange. Linus, what do you think?


P.S. Please, remove my Reviewed-by tag since code is changed enough.

-- 
Andy Shevchenko <andriy.shevchenko@...el.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ