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:	Tue, 27 Nov 2012 06:35:28 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Chanwoo Choi <cw00.choi@...sung.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	MyungJoo Ham <myungjoo.ham@...sung.com>,
	patches@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: arizona: Only set GPIO if it has been requested

On Tue, Nov 27, 2012 at 08:26:35AM +0900, Chanwoo Choi wrote:
> On 11/26/2012 08:28 PM, Mark Brown wrote:

> > +	if (arizona->pdata.micd_pol_gpio > 0)
> > +		gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
> > +					info->micd_modes[mode].gpio);

> Why not use gpio_is_valid() function to test arizona->pdata.micd_pol_gpio ?

Zero is normally a valid GPIO (since it's an index into a big array
after all) but this is unhelpful when checking to see if someone filled
in platform data as it's also the default value for uninitialised member
variables.  It's much more likely that someone didn't fill in a GPIO
than that GPIO 0 got assigned to this.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ