All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] gpiolib: fix gpiochip_machine_hog()
Date: Tue, 01 May 2018 07:36:39 +0000	[thread overview]
Message-ID: <20180501073638.GA6126@mwanda> (raw)

There is a shifter vs vanilla mask bug here.  We want to test if 1 << 11
is set but we're testing if 0xb is set.

Fixes: 9a6c505f7df1 ("gpiolib: add hogs support for machine code")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 2716c9e65131..c6cb63e43eda 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1187,7 +1187,7 @@ static void gpiochip_machine_hog(struct gpio_chip *chip, struct gpiod_hog *hog)
 		return;
 	}
 
-	if (desc->flags & FLAG_IS_HOGGED)
+	if (test_bit(FLAG_IS_HOGGED, &desc->flags))
 		return;
 
 	rv = gpiod_hog(desc, hog->line_name, hog->lflags, hog->dflags);

             reply	other threads:[~2018-05-01  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01  7:36 Dan Carpenter [this message]
2018-05-02  8:47 ` [patch] gpiolib: fix gpiochip_machine_hog() Bartosz Golaszewski
2018-05-04 16:08 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180501073638.GA6126@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.