lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 4 Mar 2024 13:52:05 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Vasileios Amoiridis <vassilisamir@...il.com>
Cc: jic23@...nel.org, lars@...afoo.de, ang.iglesiasg@...il.com,
	mazziesaccount@...il.com, ak@...klinger.de,
	petre.rodan@...dimension.ro, phil@...pberrypi.com, 579lpy@...il.com,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] iio: pressure: Add triggered buffer support for
 BMP280 driver

On Sun, Mar 03, 2024 at 05:53:00PM +0100, Vasileios Amoiridis wrote:
> Add a buffer struct that will hold the values of the measurements
> and will be pushed to userspace. Modify all read_* functions in order
> to just read and compensate the data without though converting to the
> required IIO measurement units which are used for the oneshot captures.

> +#include <linux/iio/buffer.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> +#include <linux/iio/trigger.h>
> +#include <linux/iio/trigger_consumer.h>
> +#include <linux/iio/triggered_buffer.h>

Yes, taking into account the comment against patch 1, this will become the part
of iio/* group.

..

> +	/* val might be NULL if we're called by the buffer handler */
> +	if (val) {
> +		*val = comp_press;
> +		/* Compensated pressure is in cPa (centipascals) */
> +		*val2 = 100000;

Here and everywhere else where it makes sense

		*val2 = CENTI * 1000; // (What is 1000 here?)

from units.h?

> +		return IIO_VAL_FRACTIONAL;
> +	}

..

> +	struct {
> +		s32 temperature;
> +		u32 pressure;
> +		u32 humidity;

> +		s64 timestamp;

Shouldn't this be aligned properly?

> +	} iio_buffer;

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ