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:	Thu, 23 Feb 2012 21:26:14 -0800
From:	Stephen Warren <swarren@...dia.com>
To:	Dong Aisheng <aisheng.dong@...escale.com>
CC:	Linus Walleij <linus.walleij@...aro.org>,
	Linus Walleij <linus.walleij@...ricsson.com>,
	Dong Aisheng-B29396 <B29396@...escale.com>,
	"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"dongas86@...il.com" <dongas86@...il.com>,
	"shawn.guo@...aro.org" <shawn.guo@...aro.org>,
	"thomas.abraham@...aro.org" <thomas.abraham@...aro.org>,
	"tony@...mide.com" <tony@...mide.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/3] pinctrl: Introduce PINCTRL_STATE_DEFAULT define,
 and use it

Dong Aisheng wrote at Thursday, February 23, 2012 8:25 PM:
> On Fri, Feb 24, 2012 at 08:04:38AM +0800, Stephen Warren wrote:
> > This provides a single centralized name for the default state.
> >
> > Update PIN_MAP_* macros to use this state name, instead of requiring the
> > user to pass a state name in.
...
> > diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt
...
> > -       PIN_MAP("I2CMAP", "pinctrl-foo", "i2c0", "foo-i2c.0"),
> > +	PIN_MAP(PINCTRL_STATE_DEFAULT, "pinctrl-foo", "i2c0", "foo-i2c.0"),
>
> To keep align with the following
> PIN_MAP_SYS_HOG("pinmux-u300", "power"),
> Maybe PIN_MAP("pinctrl-foo", "i2c0", "foo-i2c.0") is better, right?
> 
> And we may want to add a PIN_MAP_STAT macro, as well as PIN_MAP_SYS_HOG_STAT.

I don't think so.

PIN_MAP_SYS_HOG hard-codes the state name inside the macro because its
sole purpose is to support drivers/pinctrl/core.c's pinctrl_get() call
for pin hogging purposes, so that state name is always "default", or
rather, PINCTRL_STATE_DEFAULT.

The same isn't true of PIN_MAP; it's a general purpose macro intended for
any device/situation/... I'd rather not keep inventing tons of macros in
consumer.h and clutter it up.

I guess if you really want, you can submit a patch to add a macro e.g.
PIN_MAP_MUX_GROUP_DEFAULT() which hard-codes the default state name if
you wish, following on from my patch to extend the mapping table to
support pin config.

BTW, did you have any further thoughts on (not) allowing NULL state names?
I'd like to repost the final version of that patch, or rework it so that
the code actually does allow NULL state names ASAP (i.e. early Friday for
me), since it blocks some of the later patches in the series. Thanks.

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