* [PATCH] gpio/gpio-ich: make ichx_gpio_check_available() return a pure boolean value
@ 2013-03-07 8:48 Mika Westerberg
2013-03-27 8:22 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2013-03-07 8:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Peter Tyser, Grant Likely, Linus Walleij, Mika Westerberg
It is more readable for humans to use double-bang (!!) to convert the value
to pure boolean before it is returned.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/gpio/gpio-ich.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index f9dbd50..22ea0be 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -130,7 +130,7 @@ static int ichx_read_bit(int reg, unsigned nr)
static bool ichx_gpio_check_available(struct gpio_chip *gpio, unsigned nr)
{
- return ichx_priv.use_gpio & (1 << (nr / 32));
+ return !!(ichx_priv.use_gpio & (1 << (nr / 32)));
}
static int ichx_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio/gpio-ich: make ichx_gpio_check_available() return a pure boolean value
2013-03-07 8:48 [PATCH] gpio/gpio-ich: make ichx_gpio_check_available() return a pure boolean value Mika Westerberg
@ 2013-03-27 8:22 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2013-03-27 8:22 UTC (permalink / raw)
To: Mika Westerberg; +Cc: linux-kernel, Peter Tyser, Grant Likely
On Thu, Mar 7, 2013 at 9:48 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> It is more readable for humans to use double-bang (!!) to convert the value
> to pure boolean before it is returned.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Thanks, patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-27 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 8:48 [PATCH] gpio/gpio-ich: make ichx_gpio_check_available() return a pure boolean value Mika Westerberg
2013-03-27 8:22 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox