Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: andy.shevchenko@gmail.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer
Date: Sat, 10 Feb 2024 15:09:07 +0000	[thread overview]
Message-ID: <20240210150907.40e27f53@jic23-huawei> (raw)
In-Reply-To: <ZcEPJh1i7cc0xyBW@sunspire>

On Mon, 5 Feb 2024 18:39:02 +0200
Petre Rodan <petre.rodan@subdimension.ro> wrote:

> hello Andy,
> 
> On Sun, Feb 04, 2024 at 06:03:28PM +0200, andy.shevchenko@gmail.com wrote:
> [..]
> > > +	memcpy(&data->scan.chan[1], &data->buffer[2], 2);  
> > 
> > Hmm... We don't have fixed-size memcpy() :-(  
> 
> 	__be16 *ptr;
> 
> 	ptr = (__be16 *) data->buffer;
> 	data->scan.chan[0] = *ptr;
> 	data->scan.chan[1] = *++ptr;
> 
> is this an acceptable replacement? I do not understand that your concern was, my
> intent was to copy exactly 2 bytes over.

Andy?

I'm not sure what you meant here either.  

There is an existing oddity that the read_raw deals with this as a be32 and
masking out the right sections for each channel rather than perhaps more logical
be16 pair here.

Jonathan

> 
> > > +	iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
> > > +					   iio_get_time_ns(indio_dev));  
> 
> thanks,
> peter


  reply	other threads:[~2024-02-10 15:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 16:03 [PATCH v2 0/4] iio: pressure: hsc030pa: cleanup and triggered buffer Petre Rodan
2024-01-27 16:03 ` [PATCH v2 1/4] dt-bindings: iio: pressure: honeywell,hsc030pa.yaml add spi props Petre Rodan
2024-01-29  8:23   ` Krzysztof Kozlowski
2024-01-27 16:03 ` [PATCH v2 2/4] iio: pressure: hsc030pa cleanup Petre Rodan
2024-01-27 16:57   ` Jonathan Cameron
2024-01-27 16:03 ` [PATCH v2 3/4] iio: pressure: hsc030pa add mandatory delay Petre Rodan
2024-01-27 16:03 ` [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer Petre Rodan
2024-01-27 16:59   ` Jonathan Cameron
2024-02-04 13:44     ` Jonathan Cameron
2024-02-04 16:10       ` Jonathan Cameron
2024-02-04 16:03   ` andy.shevchenko
2024-02-05 16:39     ` Petre Rodan
2024-02-10 15:09       ` Jonathan Cameron [this message]
2024-02-10 15:12         ` Andy Shevchenko

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=20240210150907.40e27f53@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petre.rodan@subdimension.ro \
    /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