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: <ZNudeE+VNzSqFRGY@smile.fi.intel.com>
Date:   Tue, 15 Aug 2023 18:44:56 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Marcus Folkesson <marcus.folkesson@...il.com>
Cc:     Kent Gustavsson <kent@...oris.se>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Cosmin Tanislav <demonsingur@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        ChiYuan Huang <cy_huang@...htek.com>,
        Haibo Chen <haibo.chen@....com>,
        Ramona Bolboaca <ramona.bolboaca@...log.com>,
        Ibrahim Tilki <Ibrahim.Tilki@...log.com>,
        ChiaEn Wu <chiaen_wu@...htek.com>,
        William Breathitt Gray <william.gray@...aro.org>,
        linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 6/6] iio: adc: mcp3911: add support for the whole
 MCP39xx family

On Mon, Aug 14, 2023 at 02:10:10PM +0200, Marcus Folkesson wrote:
> Microchip does have many similar chips, add support for those.
> 
> The new supported chips are:
>   - microchip,mcp3910
>   - microchip,mcp3912
>   - microchip,mcp3913
>   - microchip,mcp3914
>   - microchip,mcp3918
>   - microchip,mcp3919

...

>  	struct {
> -		u32 channels[MCP3911_NUM_CHANNELS];
> +		u32 channels[MCP39XX_MAX_NUM_CHANNELS];
>  		s64 ts __aligned(8);

Can we actually have the __aligned_s64 defined?

Rhetorical... Let me send a patch for that as it's not related to this series.

>  	} scan;

...

> +	/* Enable offset*/

Missing space.

...

> +static int mcp3911_get_osr(struct mcp3911 *adc, u32 *val)
> +{
> +	int ret, osr;
> +
> +	ret = mcp3911_read(adc, MCP3911_REG_CONFIG, val, 2);
> +	if (ret)
> +		return ret;
> +
> +	osr = FIELD_GET(MCP3911_CONFIG_OSR, *val);
> +	*val = 32 << osr;

> +	return ret;

	return 0;

> +}

...

>  {
> -	struct device *dev = &adc->spi->dev;
>  	u32 regval;
>  	int ret;

> +	struct device *dev = &adc->spi->dev;

Stray change.

...

> +	/* Disable offset to ignore any old values in offset register*/

Missing space.

...

> +	u32 regval;
> +	int ret;
> +	struct device *dev = &adc->spi->dev;

Make the longer line first.

...

> +		dev_dbg(dev,
> +			"use internal voltage reference (1.2V)\n");

One line.

...

> +		dev_dbg(dev,
> +			"use crystal oscillator as clocksource\n");

Ditto.

(This is the outcome of the exercise with temporary dev variable)

...

> +	ret = device_property_read_u32(dev, "microchip,device-addr", &adc->dev_addr);
>  	if (ret)
> -		return ret;
> +		device_property_read_u32(dev, "device-addr", &adc->dev_addr);
> +	if (adc->dev_addr > 3) {

> +		dev_err_probe(dev, -EINVAL,
> +			"invalid device address (%i). Must be in range 0-3.\n",
> +			adc->dev_addr);

Missing return?

		return dev_err_probe(...);

> +	}
> +	dev_dbg(dev, "use device address %i\n", adc->dev_addr);

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ