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, 7 Mar 2013 04:23:56 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org,
	Grant Likely <grant.likely@...retlab.ca>,
	Peter Tyser <ptyser@...-inc.com>,
	Jean Delvare <khali@...ux-fr.org>
Subject: Re: [PATCH] gpio: gpio-ich: fix ichx_gpio_check_available() return
 what callers expect

Hi Mika,

On Wed, Feb 27, 2013 at 4:25 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:

> -static int ichx_gpio_check_available(struct gpio_chip *gpio, unsigned nr)
> +static bool ichx_gpio_check_available(struct gpio_chip *gpio, unsigned nr)
>  {
> -       return (ichx_priv.use_gpio & (1 << (nr / 32))) ? 0 : -ENXIO;
> +       return ichx_priv.use_gpio & (1 << (nr / 32));
>  }

Strictly speaking what you're returning there is not a bool.
Shouldn't it be:

return !!(ichx_priv.use_gpio & (1 << (nr / 32)));

?

Yours,
Linus Walleij
--
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