[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb09b6f882a786a74919eda8812f27d502363150.camel@analog.com>
Date: Tue, 17 Mar 2020 12:53:16 +0000
From: "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To: "ardeleanalex@...il.com" <ardeleanalex@...il.com>,
"andriy.shevchenko@...ux.intel.com"
<andriy.shevchenko@...ux.intel.com>
CC: "jic23@...nel.org" <jic23@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"lars@...afoo.de" <lars@...afoo.de>
Subject: Re: [PATCH] iio: buffer: re-introduce bitmap_zalloc() for trialmask
On Tue, 2020-03-17 at 14:52 +0200, Andy Shevchenko wrote:
> [External]
>
> On Tue, Mar 17, 2020 at 02:36:21PM +0200, Alexandru Ardelean 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.
>
> FWIW,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Thanks.
And sorry for the hiccup back there.
>
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.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) {
> > --
> > 2.20.1
> >
Powered by blists - more mailing lists