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] [day] [month] [year] [list]
Message-ID: <20211002171622.0f5d34d7@jic23-huawei>
Date:   Sat, 2 Oct 2021 17:16:22 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Roan van Dijk <roan@...tonic.nl>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Tomasz Duszynski <tomasz.duszynski@...akon.com>,
        linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, david@...tonic.nl,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v4 3/4] drivers: iio: chemical: Add support for
 Sensirion SCD4x CO2 sensor

On Fri,  1 Oct 2021 09:02:53 +0200
Roan van Dijk <roan@...tonic.nl> wrote:

> This is a driver for the SCD4x CO2 sensor from Sensirion. The sensor is
> able to measure CO2 concentration, temperature and relative humdity.
> The sensor uses a photoacoustic principle for measuring CO2 concentration.
> An I2C interface is supported by this driver in order to communicate with
> the sensor.
> 
> Signed-off-by: Roan van Dijk <roan@...tonic.nl>
Hi Roan,

Looks like you sent out wrong version or similar as the trigger_handler
won't work as you have it here.  Otherwise looks good to me.

...

> +static irqreturn_t scd4x_trigger_handler(int irq, void *p)
> +{
> +	struct iio_poll_func *pf = p;
> +	struct iio_dev *indio_dev = pf->indio_dev;
> +	struct scd4x_state *state = iio_priv(indio_dev);
> +	struct {
> +		uint16_t data[3];
> +		int64_t ts __aligned(8);
> +	} scan;
> +	int ret;
> +	uint16_t buf[3];
> +
> +	memset(&scan, 0, sizeof(scan));
> +	mutex_lock(&state->lock);
> +	ret = scd4x_read_poll(state, buf);

scan->data and drop the local variable buf as unused.

If I've interpreted the intent right here I'm happy to make this tweak
whilst applying.  If you prefer to send a v5 with it fixed up that is
fine as well.


> +	mutex_unlock(&state->lock);
> +	if (ret)
> +		goto out;
> +
> +	iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns(indio_dev));
> +out:
> +	iio_trigger_notify_done(indio_dev->trig);
> +	return IRQ_HANDLED;
> +}
> +
...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ