From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<lars@metafoo.de>, <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v2] iio: buffer: re-introduce bitmap_zalloc() for trialmask
Date: Sun, 22 Mar 2020 17:01:31 +0000 [thread overview]
Message-ID: <20200322170131.3e83f0bd@archlinux> (raw)
In-Reply-To: <20200321085956.11213-1-alexandru.ardelean@analog.com>
On Sat, 21 Mar 2020 10:59:56 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> Commit 3862828a903d3 ("iio: buffer: Switch to bitmap_zalloc()") introduced
> bitmap_alloc(), but commit 20ea39ef9f2f9 ("iio: Fix scan mask selection")
> reverted it.
>
> This change adds it back. The only difference is that it's adding
> bitmap_zalloc(). There might be some changes later that would require
> initializing it to zero. In any case, now it's already zero-ing the
> trialmask.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to poke it.
Thanks,
Jonathan
> ---
>
> Changelog v1 -> v2:
> * add 'Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>'
> * re-send from an Analog server; GMail changed the author to @gmail.com
>
> drivers/iio/industrialio-buffer.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 4ada5592aa2b..5ff34ce8b6a2 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
> const unsigned long *mask;
> unsigned long *trialmask;
>
> - trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
> - sizeof(*trialmask), GFP_KERNEL);
> + trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL);
> if (trialmask == NULL)
> return -ENOMEM;
> if (!indio_dev->masklength) {
prev parent reply other threads:[~2020-03-22 17:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 12:36 [PATCH] iio: buffer: re-introduce bitmap_zalloc() for trialmask Alexandru Ardelean
2020-03-17 12:52 ` Andy Shevchenko
2020-03-17 12:53 ` Ardelean, Alexandru
2020-03-17 13:18 ` Lars-Peter Clausen
2020-03-22 17:02 ` Jonathan Cameron
2020-03-21 8:59 ` [PATCH v2] " Alexandru Ardelean
2020-03-22 17:01 ` Jonathan Cameron [this message]
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=20200322170131.3e83f0bd@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).