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: <74CDBE0F657A3D45AFBB94109FB122FF1740805F1A@HQMAIL01.nvidia.com>
Date:	Tue, 15 Nov 2011 15:32:34 -0800
From:	Stephen Warren <swarren@...dia.com>
To:	Denis Kuzmenko <linux@...onet.org.ua>,
	Wolfram Sang <w.sang@...gutronix.de>,
	Dong Aisheng <dong.aisheng@...aro.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Grant Likely <grant.likely@...retlab.ca>
Subject: RE: [PATCH] gpio: add flags to export GPIOs when requesting

Denis Kuzmenko wrote at Tuesday, November 15, 2011 4:05 PM:
> Hi Wolfram,
> On 11/16/2011 12:44 AM, Wolfram Sang wrote:
> > Introduce new flags to automatically export GPIOs when using the convenience
> > functions gpio_request_one() or gpio_request_array(). This eases support for
> > custom boards where lots of GPIOs need to be exported for customer
> > applications.
> 
> Adding GPIO maintainer Grant Likely to CC.
> 
> > +#define GPIOF_EXPORT		(1 << 2)
> > +#define GPIOF_EXPORT_CHANGEABLE	(1 << 3)
> > +#define GPIOF_EXPORT_DIR_FIXED	(GPIOF_EXPORT)
> > +#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
> 
> Maybe, it's better to write like this:
> 
> #define GPIOF_EXPORT			(1 << 2)
> #define GPIOF_EXPORT_DIR_CHANGEABLE	(3 << 2)

Then you won't have a single flag to check if the dir is changeable.

Personally, I'd go for the two single-bit flags, and force boards to OR
them together if they want the GPIO exported and with a changeable
direction; just get rid of the two _DIR_ flags. That said, Wolfram's
patch seems to follow the conventions already in the file.

Dong Aisheng posted patch "gpio: introduce gpio_export_array to ease
export for gpio arrays". Which should we pick; it doesn't seem like we
need both mechanisms.

-- 
nvpublic

--
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