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]
Message-ID: <CAAVeFuK0qe9Hi8OZv9pJjZYFZB_DexPJOD-D2=4DSG==7nHkJg@mail.gmail.com>
Date:	Thu, 31 Jul 2014 12:43:32 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Alexandre Courbot <acourbot@...dia.com>,
	Mark Brown <broonie@...nel.org>,
	Thierry Reding <thierry.reding@...il.com>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Arnd Bergmann <arnd@...db.de>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: add flags argument to gpiod_get*() functions

On Mon, Jul 28, 2014 at 7:30 PM, Linus Walleij <linus.walleij@...aro.org> wrote:
> On Fri, Jul 25, 2014 at 4:38 PM, Alexandre Courbot <acourbot@...dia.com> wrote:
>
>> The huge majority of GPIOs have their direction and initial value set
>> right after being obtained by one of the gpiod_get() functions. The
>> integer GPIO API had gpio_request_one() that took a convenience flags
>> parameter allowing to specify an direction and value applied to the
>> returned GPIO. This feature greatly simplifies client code and ensures
>> errors are always handled properly.
>>
>> A similar feature has been requested for the gpiod API. Since setting
>> the direction of a GPIO is so often the very next action done after
>> obtaining its descriptor, we prefer to extend the existing functions
>> instead of introducing new functions that would raise the
>> number of gpiod getters to 16 (!).
>>
>> The drawback of this approach is that all gpiod clients need to be
>> updated. To limit the pain, temporary macros are introduced that allow
>> gpiod_get*() to be called with or without the extra flags argument. They
>> will be removed once all consumer code has been updated.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
>> ---
>> This dude can be applied harmlessly to the GPIO tree - then I will go
>> after every gpiod user to update the calls to gpiod_get*() before
>> removing the macros in consumer.h.
>
> OK I trust you. Patch applied with Broonie's review tag.

Thanks! Unfortunately it is still not in -next due to a build error...

> Just so we don't forget how we should move forward: Alex what do
> you think about adding a drivers/gpio/TODO.TXT file outlining the
> overall plan of the gpiod refactoring and clean-up work?

I have such a file locally - I'm not sure if checking it into the
kernel tree is relevant though. Sounds more like the task of a wiki
page.
--
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