Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbdLQJow convert rfc822-to-8bit (ORCPT ); Sun, 17 Dec 2017 04:44:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:51904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990AbdLQJos (ORCPT ); Sun, 17 Dec 2017 04:44:48 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0357121897 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sun, 17 Dec 2017 09:44:30 +0000 From: Jonathan Cameron To: Stefan =?UTF-8?B?QnLDvG5z?= Cc: , Peter Meerwald-Stadler , Maciej Purski , , "Andrew F . Davis" , Lars-Peter Clausen , Hartmut Knaack , "Javier Martinez Canillas" Subject: Re: [PATCH v1 2/7] iio: adc: ina2xx: Clarify size requirement for data buffer Message-ID: <20171217094430.4e4908ca@archlinux> In-Reply-To: References: <20171208174152.30341-1-stefan.bruens@rwth-aachen.de> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1115 Lines: 31 On Fri, 8 Dec 2017 18:41:47 +0100 Stefan Brüns wrote: > The timestamp is inserted into the buffer after the sample data by > iio_push_to_buffers_with_timestamp, document the space requirement for > the timestamp. > > Signed-off-by: Stefan Brüns Applied and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > > drivers/iio/adc/ina2xx-adc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c > index 3195f8754c3b..8c8120406f52 100644 > --- a/drivers/iio/adc/ina2xx-adc.c > +++ b/drivers/iio/adc/ina2xx-adc.c > @@ -700,7 +700,8 @@ static const struct iio_chan_spec ina219_channels[] = { > static int ina2xx_work_buffer(struct iio_dev *indio_dev) > { > struct ina2xx_chip_info *chip = iio_priv(indio_dev); > - unsigned short data[8]; > + /* data buffer needs space for channel data and timestap */ > + unsigned short data[4 + sizeof(s64)/sizeof(short)]; > int bit, ret, i = 0; > s64 time_a, time_b; > unsigned int alert;