diff mbox

gpio: msm-v1: Fix typo in function argument

Message ID 1414160997-30575-1-git-send-email-daniel.thompson@linaro.org
State Accepted
Headers show

Commit Message

Daniel Thompson Oct. 24, 2014, 2:29 p.m. UTC
irq_set_irq_wake() treats its second argument as a boolean. It is much
easier to read code when constant booleans are either 0 or 1!

This particular line of code distracted me somewhat when I was doing a bit of
work in a code browser since it (spuriously) got me worried that I had
misunderstood how irq_set_irq_wake() worked.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
---
 drivers/gpio/gpio-msm-v1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alexandre Courbot Oct. 27, 2014, 5 a.m. UTC | #1
On Fri, Oct 24, 2014 at 11:29 PM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
> irq_set_irq_wake() treats its second argument as a boolean. It is much
> easier to read code when constant booleans are either 0 or 1!
>
> This particular line of code distracted me somewhat when I was doing a bit of
> work in a code browser since it (spuriously) got me worried that I had
> misunderstood how irq_set_irq_wake() worked.
>
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> ---
>  drivers/gpio/gpio-msm-v1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
> index 73b7396..997e61e 100644
> --- a/drivers/gpio/gpio-msm-v1.c
> +++ b/drivers/gpio/gpio-msm-v1.c
> @@ -686,7 +686,7 @@ static int gpio_msm_v1_probe(struct platform_device *pdev)
>         irq_set_chained_handler(irq1, msm_gpio_irq_handler);
>         irq_set_chained_handler(irq2, msm_gpio_irq_handler);
>         irq_set_irq_wake(irq1, 1);
> -       irq_set_irq_wake(irq2, 2);
> +       irq_set_irq_wake(irq2, 1);
>         return 0;

That could be confusing indeed.

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 30, 2014, 3 p.m. UTC | #2
On Fri, Oct 24, 2014 at 4:29 PM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:

> irq_set_irq_wake() treats its second argument as a boolean. It is much
> easier to read code when constant booleans are either 0 or 1!
>
> This particular line of code distracted me somewhat when I was doing a bit of
> work in a code browser since it (spuriously) got me worried that I had
> misunderstood how irq_set_irq_wake() worked.
>
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>

Patch applied with Alexandre's Review tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
index 73b7396..997e61e 100644
--- a/drivers/gpio/gpio-msm-v1.c
+++ b/drivers/gpio/gpio-msm-v1.c
@@ -686,7 +686,7 @@  static int gpio_msm_v1_probe(struct platform_device *pdev)
 	irq_set_chained_handler(irq1, msm_gpio_irq_handler);
 	irq_set_chained_handler(irq2, msm_gpio_irq_handler);
 	irq_set_irq_wake(irq1, 1);
-	irq_set_irq_wake(irq2, 2);
+	irq_set_irq_wake(irq2, 1);
 	return 0;
 }