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:   Tue, 8 Aug 2023 17:13:25 +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 v4 3/4] iio: adc: mcp3911: fix indentation

On Tue, Aug 08, 2023 at 01:04:31PM +0200, Marcus Folkesson wrote:
> The file does not make use of indentation properly.
> Fix that.

...

>  static int mcp3911_update(struct mcp3911 *adc, u8 reg, u32 mask,
> -		u32 val, u8 len)
> +			  u32 val, u8 len)

Can val be moved to the previous line?

...

>  		if (ret < 0) {
>  			dev_err(&adc->spi->dev,
>  				"failed to get vref voltage: %d\n",
> -			       ret);
> +				ret);
>  			return ret;

With

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

this becomes

			dev_err(dev, "failed to get vref voltage: %d\n", ret);

and one change less here.

>  		}

...

> -#define MCP3911_CHAN(idx) {					\
> -		.type = IIO_VOLTAGE,				\
> -		.indexed = 1,					\
> -		.channel = idx,					\
> -		.scan_index = idx,				\
> -		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \
> -		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
> -			BIT(IIO_CHAN_INFO_OFFSET) |		\
> -			BIT(IIO_CHAN_INFO_SCALE),		\
> -		.info_mask_shared_by_type_available =           \
> -			BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),	\
> -		.info_mask_separate_available =			\
> -			BIT(IIO_CHAN_INFO_SCALE),		\
> -		.scan_type = {					\
> -			.sign = 's',				\
> -			.realbits = 24,				\
> -			.storagebits = 32,			\
> -			.endianness = IIO_BE,			\
> -		},						\

>  }

This looks like unneeded churn to me.

...

>  	if (ret < 0) {
>  		dev_warn(&adc->spi->dev,
> -				"failed to get conversion data\n");
> +			 "failed to get conversion data\n");
>  		goto out;
>  	}

Same as above with temporary variable for struct device.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ