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: <6D279EC4-6124-45C2-BCBB-D6CBB3385024@gmail.com>
Date:   Wed, 12 Oct 2022 08:30:45 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org
Subject: Re: [PATCH 6/7] gpiolib: of: factor out code overriding gpio line polarity

On October 12, 2022 4:10:37 AM PDT, Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
>On Tue, Oct 11, 2022 at 03:19:34PM -0700, Dmitry Torokhov wrote:
>> There are several instances where we use a separate property to
>> override polarity specified in gpio property. Factor it out into
>> a separate function.
>
>...
>
>>  static void of_gpio_flags_quirks(const struct device_node *np,
>>  				 const char *propname,
>>  				 enum of_gpio_flags *flags,
>> @@ -145,7 +167,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
>>  	     (!(strcmp(propname, "enable-gpio") &&
>>  		strcmp(propname, "enable-gpios")) &&
>>  	      of_device_is_compatible(np, "regulator-gpio")))) {
>> -		bool active_low = !of_property_read_bool(np,
>> +		bool active_high = of_property_read_bool(np,
>
>Defining
>
>	bool active_high;
>
>at the top of the function will save you a few ugly indented code lines here
>and in the next patch.
>

Indeed, but I think the idea was to keep the quirks as independent as possible.
I guess I could split it further into separate functions, like the other quirk handling. 

Bartosz, Linus, any preference here? 

Thanks. 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ