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]
Message-ID: <20221009174154.41569d52@jic23-huawei>
Date:   Sun, 9 Oct 2022 17:41:54 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Ibrahim Tilki <Ibrahim.Tilki@...log.com>
Cc:     <linux-iio@...r.kernel.org>, <Nuno.Sa@...log.com>,
        <Nurettin.Bolucu@...log.com>, <robh+dt@...nel.org>,
        <krzysztof.kozlowski+dt@...aro.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 1/3] iio: adc: add max11410 adc driver

On Mon, 3 Oct 2022 13:59:01 +0300
Ibrahim Tilki <Ibrahim.Tilki@...log.com> wrote:

> Adding support for max11410 24-bit, 1.9ksps delta-sigma adc which
> has 3 differential reference and 10 differential channel inputs.
> Inputs and references can be buffered internally. Inputs can also
> be amplified with internal PGA.
> 
> Device has four digital filter modes: FIR50/60, FIR50, FIR60 and SINC4.
> FIR 50Hz and 60Hz rejections can be enabled/disabled separately.
> Digital filter selection affects sampling frequency range so driver
> has to consider the configured filter when configuring sampling frequency.
> 
> Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@...log.com>
One small thing inline that I tidied up whilst applying.


> +static int max11410_configure_channel(struct max11410_state *st,
> +				      struct iio_chan_spec const *chan)
> +{
> +	struct max11410_channel_config cfg = st->channels[chan->address];
> +	unsigned int regval;
> +	int ret;
> +
> +	if (chan->differential)
> +		ret = max11410_set_input_mux(st, chan->channel, chan->channel2);
> +	else
> +		ret = max11410_set_input_mux(st, chan->channel,
> +					     MAX11410_AINN_GND);
> +
> +	if (ret)
> +		return ret;
> +
> +	regval = FIELD_PREP(MAX11410_CTRL_VREFP_BUF_BIT, cfg.buffered_vrefp) |
> +		 FIELD_PREP(MAX11410_CTRL_VREFN_BUF_BIT, cfg.buffered_vrefn) |
> +		 FIELD_PREP(MAX11410_CTRL_REFSEL_MASK, cfg.refsel) |
> +		 FIELD_PREP(MAX11410_CTRL_UNIPOLAR_BIT, !cfg.bipolar);
drivers/iio/adc/max11410.c:370:18: warning: dubious: x & !y 

I've fixed it with
... cfg.bipolar ? 0 : 1);

Shout if that's an issue (I've gotten these backwards in the past ;)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ