[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240210150907.40e27f53@jic23-huawei>
Date: Sat, 10 Feb 2024 15:09:07 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Petre Rodan <petre.rodan@...dimension.ro>
Cc: andy.shevchenko@...il.com, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer
On Mon, 5 Feb 2024 18:39:02 +0200
Petre Rodan <petre.rodan@...dimension.ro> wrote:
> hello Andy,
>
> On Sun, Feb 04, 2024 at 06:03:28PM +0200, andy.shevchenko@...il.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
Powered by blists - more mailing lists