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, 27 Oct 2011 08:59:43 -0700
From:	Stephen Warren <swarren@...dia.com>
To:	Belisko Marek <marek.belisko@...il.com>,
	David Rientjes <rientjes@...gle.com>,
	"grant.likely@...retlab.ca" <grant.likely@...retlab.ca>,
	"linus.walleij@...aro.org" <linus.walleij@...aro.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 2/2] pinmux: Unify pin type from signed to unsigned.

Belisko Marek wrote at Thursday, October 27, 2011 12:13 AM:
> On Wed, Oct 26, 2011 at 11:06 PM, David Rientjes <rientjes@...gle.com> wrote:
> > On Wed, 26 Oct 2011, Marek Belisko wrote:
> >
> >> diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
> >> index 3605e94..34c33c7 100644
> >> --- a/include/linux/pinctrl/pinctrl.h
> >> +++ b/include/linux/pinctrl/pinctrl.h
> >> @@ -112,7 +112,7 @@ struct pinctrl_desc {
> >>  extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
> >>                               struct device *dev, void *driver_data);
> >>  extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
> >> -extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
> >> +extern bool pin_is_valid(struct pinctrl_dev *pctldev, unsigned int pin);
> >>  extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
> >>                               struct pinctrl_gpio_range *range);
> >>  extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
> >> @@ -123,7 +123,7 @@ extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
> >>
> >>
> >>  /* Sufficiently stupid default function when pinctrl is not in use */
> >> -static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
> >> +static inline bool pin_is_valid(struct pinctrl_dev *pctldev, unsigned int pin)
> >>  {
> >>       return pin >= 0;
> >>  }
> >
> >
> > So this would just become return true, right?
>
> Right I've overlooked it. Will send update version.

I wonder if the type shouldn't be signed consistently rather than unsigned,
since a signed value, -1, is typically used to indicate "invalid pin".

I wonder if the dummy pin_is_valid() should actually return false rather
than true; that's what <linux/gpio.h> does, but asm-generic/gpio.h always
returns true, like your updated pinctrl patch would.

Looking at include/linux/gpio.h, gpiolib has the same issue with signed/
unsigned inconsistency. Whatever solution we pick for pinctrl should be
consistent with gpiolib; Grant should comment here.

-- 
nvpublic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ