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:	Mon, 3 Aug 2009 12:15:57 +0300
From:	Roger Quadros <quadros.roger@...il.com>
To:	pHilipp Zabel <philipp.zabel@...il.com>
Cc:	broonie@...ena.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] regulator: Add GPIO enable control to fixed voltage 
	regulator driver

On Sun, Aug 2, 2009 at 8:49 PM, pHilipp Zabel<philipp.zabel@...il.com> wrote:
> On Sun, Aug 2, 2009 at 6:56 PM, Roger Quadros<quadros.roger@...il.com> wrote:
>> From: Roger Quadros <ext-roger.quadros@...ia.com>
>>
>> +
>> +               /* set output direction without changing state
>> +                * to prevent glitch
>> +                */
>> +               drvdata->is_enabled = config->enabled_at_boot;
>> +               if (!config->enable_high)
>> +                       drvdata->is_enabled = !drvdata->is_enabled;
>
> Assume .enabled_at_boot = 1, .enable_high = 0. In this case we end up
> with .is_enabled = 0, which does not represent the real state after
> the following call:
>
>> +               ret = gpio_direction_output(config->gpio, drvdata->is_enabled);
>
> Maybe use a local variable here or (drvdata->is_enabled ?
> config->enable_high : !config->enable_high).
>
> regards
> Philipp
>

Yes you are right.
--
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