From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Baluta <daniel.baluta@gmail.com>,
Hartmut Knaack <knaack.h@gmx.de>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Subject: Re: [PATCH 3/6] iio:dac:m62332: use ARRAY_SIZE
Date: Sun, 11 Oct 2015 15:43:15 +0100 [thread overview]
Message-ID: <561A7583.3070709@kernel.org> (raw)
In-Reply-To: <CAEnQRZDnFUKpRNS0Qs+cg0dhnp3Uy==pZ8qp6wss=U8B_yn5LQ@mail.gmail.com>
On 31/08/15 13:58, Daniel Baluta wrote:
> On Sat, Aug 29, 2015 at 12:59 AM, Hartmut Knaack <knaack.h@gmx.de> wrote:
>> Make use of ARRAY_SIZE to prevent buffer issues.
>>
>> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
>
> Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Applied to the togreg branch of iio.git - pushed out as testing
for now.
J
>
>> ---
>> drivers/iio/dac/m62332.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c
>> index c61720de8606..fe750982b502 100644
>> --- a/drivers/iio/dac/m62332.c
>> +++ b/drivers/iio/dac/m62332.c
>> @@ -62,8 +62,8 @@ static int m62332_set_value(struct iio_dev *indio_dev,
>> goto out;
>> }
>>
>> - res = i2c_master_send(client, outbuf, 2);
>> - if (res >= 0 && res != 2)
>> + res = i2c_master_send(client, outbuf, ARRAY_SIZE(outbuf));
>> + if (res >= 0 && res != ARRAY_SIZE(outbuf))
>> res = -EIO;
>> if (res < 0)
>> goto out;
>> @@ -212,7 +212,7 @@ static int m62332_probe(struct i2c_client *client,
>> /* establish that the iio_dev is a child of the i2c device */
>> indio_dev->dev.parent = &client->dev;
>>
>> - indio_dev->num_channels = M62332_CHANNELS;
>> + indio_dev->num_channels = ARRAY_SIZE(m62332_channels);
>> indio_dev->channels = m62332_channels;
>> indio_dev->modes = INDIO_DIRECT_MODE;
>> indio_dev->info = &m62332_info;
>> --
>> 2.4.6
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-10-11 14:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 21:59 [PATCH 0/6] fixes, cleanup and improvements for m62332 Hartmut Knaack
2015-08-28 21:59 ` [PATCH 1/6] iio:dac:m62332: share scale and offset Hartmut Knaack
2015-08-31 14:53 ` Jonathan Cameron
2015-09-12 10:11 ` Jonathan Cameron
2015-09-12 10:14 ` Jonathan Cameron
2015-09-27 15:56 ` Jonathan Cameron
2015-10-11 14:40 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 2/6] iio:dac:m62332: shutdown on remove Hartmut Knaack
2015-08-31 12:56 ` Daniel Baluta
2015-08-31 19:26 ` Hartmut Knaack
2015-10-11 14:42 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 3/6] iio:dac:m62332: use ARRAY_SIZE Hartmut Knaack
2015-08-31 12:58 ` Daniel Baluta
2015-10-11 14:43 ` Jonathan Cameron [this message]
2015-08-28 21:59 ` [PATCH 4/6] iio:dac:m62332: drop unrequired variable Hartmut Knaack
2015-08-31 19:46 ` Daniel Baluta
2015-10-11 14:44 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 5/6] iio:dac:m62332: address some style issues Hartmut Knaack
2015-10-11 14:45 ` Jonathan Cameron
2015-08-28 21:59 ` [PATCH 6/6] iio:dac:m62332: use dynamic scale Hartmut Knaack
2015-10-11 14:46 ` Jonathan Cameron
2015-08-31 15:00 ` [PATCH 0/6] fixes, cleanup and improvements for m62332 Jonathan Cameron
2015-08-31 16:09 ` Dmitry Eremin-Solenikov
2015-09-12 10:13 ` Jonathan Cameron
2015-10-03 11:16 ` Jonathan Cameron
2015-10-11 14:38 ` Jonathan Cameron
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=561A7583.3070709@kernel.org \
--to=jic23@kernel.org \
--cc=daniel.baluta@gmail.com \
--cc=dbaryshkov@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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.