From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Lucas Stankus <lucas.p.stankus@gmail.com>
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-iio <linux-iio@vger.kernel.org>,
<linux-staging@lists.linux.dev>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: iio: cdc: ad7746: avoid overwrite of num_channels
Date: Tue, 18 May 2021 13:08:33 +0100 [thread overview]
Message-ID: <20210518130833.00001807@Huawei.com> (raw)
In-Reply-To: <CACKVXZA9rPGLLxyq3gWTynoH7dPgYitqe-dO=YNad7VxHfwQhA@mail.gmail.com>
On Mon, 17 May 2021 21:55:20 -0300
Lucas Stankus <lucas.p.stankus@gmail.com> wrote:
> On Wed, May 12, 2021 at 2:20 PM Alexandru Ardelean
> <ardeleanalex@gmail.com> wrote:
> >
> > On Tue, May 11, 2021 at 11:55 PM Lucas Stankus
> > <lucas.p.stankus@gmail.com> wrote:
> > >
> > > AD7745 devices don't have the CIN2 pins and therefore can't handle related
> > > channels. Forcing the number of AD7746 channels may lead to enabling more
> > > channels than what the hardware actually supports.
> > > Avoid num_channels being overwritten after first assignment.
> > >
> > > Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com>
> > > ---
> > > drivers/staging/iio/cdc/ad7746.c | 1 -
> > > 1 file changed, 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
> > > index e03d010b2f4c..9e0da43b2871 100644
> > > --- a/drivers/staging/iio/cdc/ad7746.c
> > > +++ b/drivers/staging/iio/cdc/ad7746.c
> > > @@ -693,7 +693,6 @@ static int ad7746_probe(struct i2c_client *client,
> > > indio_dev->num_channels = ARRAY_SIZE(ad7746_channels);
> > > else
> > > indio_dev->num_channels = ARRAY_SIZE(ad7746_channels) - 2;
> > > - indio_dev->num_channels = ARRAY_SIZE(ad7746_channels);
> >
> > ohh; good catch
> >
> > this falls into the category of a fix, so a Fixes tag is required;
> > this looks so old, that i did not bother tracking it before
> > 83e416f458d53 [which is 2011]
>
> As Jonathan said, this bug was already fixed and the patch will be dropped,
> but thank you for the review.
>
> This was my first bug fix in the kernel, so sorry for the absence of a
> Fixes tag, I'll make sure to add one next time.
>
Wasn't already fixed - I just applied this patch without PATCH 1/2
so now it is ;)
Jonathan
>
> >
> > so, maybe something like:
> >
> > Fixes: 83e416f458d53 ("staging: iio: adc: Replace, rewrite ad7745 from
> > scratch.")
> >
> > > indio_dev->modes = INDIO_DIRECT_MODE;
> > >
> > > if (pdata) {
> > > --
> > > 2.31.1
> > >
prev parent reply other threads:[~2021-05-18 12:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 20:53 [PATCH 0/2] staging: iio: cdc: ad7746: initial effort to move out of staging Lucas Stankus
2021-05-11 20:54 ` [PATCH 1/2] staging: iio: cdc: ad7746: clean up driver comments and probe return Lucas Stankus
2021-05-12 7:45 ` Fabio Aiuto
2021-05-13 16:00 ` Jonathan Cameron
2021-05-18 0:43 ` Lucas Stankus
2021-05-11 20:54 ` [PATCH 2/2] staging: iio: cdc: ad7746: avoid overwrite of num_channels Lucas Stankus
2021-05-12 17:20 ` Alexandru Ardelean
2021-05-13 15:52 ` Jonathan Cameron
2021-05-18 0:49 ` Lucas Stankus
2021-05-18 0:55 ` Lucas Stankus
2021-05-18 12:08 ` 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=20210518130833.00001807@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=ardeleanalex@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lucas.p.stankus@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 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.