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: <20240829190004.GB3493@vamoiridPC>
Date: Thu, 29 Aug 2024 21:00:04 +0200
From: Vasileios Amoiridis <vassilisamir@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Vasileios Amoiridis <vassilisamir@...il.com>, jic23@...nel.org,
	lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org,
	conor+dt@...nel.org, ang.iglesiasg@...il.com,
	linus.walleij@...aro.org, biju.das.jz@...renesas.com,
	javier.carrasco.cruz@...il.com, semen.protsenko@...aro.org,
	579lpy@...il.com, ak@...klinger.de, linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	christophe.jaillet@...adoo.fr
Subject: Re: [PATCH v4 2/7] iio: pressure: bmp280: Add support for bmp280
 soft reset

On Thu, Aug 29, 2024 at 03:10:22PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 28, 2024 at 10:51:22PM +0200, Vasileios Amoiridis wrote:
> > The BM(P/E)28x devices have an option for soft reset which is also
> > recommended by the Bosch Sensortech BME2 Sensor API to be used before the
> > initial configuration of the device.
> 
> ...
> 
> > +static int bmp280_preinit(struct bmp280_data *data)
> > +{
> 
> With
> 
> 	struct device *dev = data->dev;
> 
> it will look better?
> 

Yes, that could be used.

> > +	unsigned int reg;
> > +	int ret;
> 
> > +	ret = regmap_write(data->regmap, BMP280_REG_RESET, BMP280_RST_SOFT_CMD);
> > +	if (ret)
> 
> > +		return dev_err_probe(data->dev, ret,
> > +				     "Failed to reset device.\n");
> 
> 		return dev_err_probe(dev, ret, "Failed to reset device.\n");
> 

ACK.

> > +	/*
> > +	 * According to the datasheet in Chapter 1: Specification, Table 2,
> > +	 * after resetting, the device uses the complete power-on sequence so
> > +	 * it needs to wait for the defined start-up time.
> > +	 */
> > +	fsleep(data->start_up_time);
> > +
> > +	ret = regmap_read(data->regmap, BMP280_REG_STATUS, &reg);
> > +	if (ret)
> 
> > +		return dev_err_probe(data->dev, ret,
> > +				     "Failed to read status register.\n");
> 
> 		return dev_err_probe(dev, ret, "Failed to read status register.\n");
> 

ACK.

> > +	if (reg & BMP280_REG_STATUS_IM_UPDATE)
> 
> > +		return dev_err_probe(data->dev, -EIO,
> > +				     "Failed to copy NVM contents.\n");
> 
> 		return dev_err_probe(dev, -EIO, "Failed to copy NVM contents.\n");
> 

ACK.

> > +	return 0;
> > +}
> 
> Yes, it's up to 84 characters long, but I think it improves readability.
> 

In all the previous cases though, shouldn't checkpatch.pl generate errors?
I didn't notice that they were below 80 chars and I never checked more
because checkpatch.pl didn't say anything...

> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ