public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] gpio: sim: fix setting and getting multiple lines
Date: Wed, 13 Apr 2022 19:53:36 +0300	[thread overview]
Message-ID: <YlcAEPYOBHk+NAD8@smile.fi.intel.com> (raw)
In-Reply-To: <20220413140132.286848-1-brgl@bgdev.pl>

On Wed, Apr 13, 2022 at 04:01:32PM +0200, Bartosz Golaszewski wrote:
> We need to take mask into account in the set/get_multiple() callbacks.
> Use bitmap_replace() instead of bitmap_copy().

Good catch!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Fixes: cb8c474e79be ("gpio: sim: new testing module")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  drivers/gpio/gpio-sim.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index 8e5d87984a48..41c31b10ae84 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -134,7 +134,7 @@ static int gpio_sim_get_multiple(struct gpio_chip *gc,
>  	struct gpio_sim_chip *chip = gpiochip_get_data(gc);
>  
>  	mutex_lock(&chip->lock);
> -	bitmap_copy(bits, chip->value_map, gc->ngpio);
> +	bitmap_replace(bits, bits, chip->value_map, mask, gc->ngpio);
>  	mutex_unlock(&chip->lock);
>  
>  	return 0;
> @@ -146,7 +146,7 @@ static void gpio_sim_set_multiple(struct gpio_chip *gc,
>  	struct gpio_sim_chip *chip = gpiochip_get_data(gc);
>  
>  	mutex_lock(&chip->lock);
> -	bitmap_copy(chip->value_map, bits, gc->ngpio);
> +	bitmap_replace(chip->value_map, chip->value_map, bits, mask, gc->ngpio);
>  	mutex_unlock(&chip->lock);
>  }
>  
> -- 
> 2.32.0
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-04-13 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 14:01 [PATCH] gpio: sim: fix setting and getting multiple lines Bartosz Golaszewski
2022-04-13 16:53 ` Andy Shevchenko [this message]
2022-04-13 19:22   ` Bartosz Golaszewski

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=YlcAEPYOBHk+NAD8@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox