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: <20250409181250.00001c9f@huawei.com>
Date: Wed, 9 Apr 2025 18:12:50 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Andy Shevchenko <andy@...nel.org>
CC: <jean-baptiste.maneyrol@....com>, Jonathan Cameron <jic23@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
	David Lechner <dlechner@...libre.com>, Nuno Sá
	<nuno.sa@...log.com>, <linux-iio@...r.kernel.org>,
	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] iio: imu: inv_icm42600: switch to use generic
 name irq get

On Wed, 9 Apr 2025 20:07:43 +0300
Andy Shevchenko <andy@...nel.org> wrote:

> On Wed, Apr 09, 2025 at 05:14:32PM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
> > From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@....com>
> > 
> > Use generic fwnode_irq_get_byname() for getting interrupt pin using
> > interrupt name. Only INT1 is supported by the driver currently.
> > 
> > If not found fallback to first defined interrupt to keep compatibility.  
> 
> ...
> 
> > -int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
> > +int inv_icm42600_core_probe(struct regmap *regmap, int chip,
> >  			    inv_icm42600_bus_setup bus_setup);  
> 
> If you use 100 limit, it fits now on one line.

I'd rather stick to 'just over 80' where it really helps. Rather than
generally switch to 100.  Maybe that day will come but I'm not sure it is
yet.

> 
> ...
> 
> > -int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
> > +int inv_icm42600_core_probe(struct regmap *regmap, int chip,
> >  			    inv_icm42600_bus_setup bus_setup)  
> 
> Ditto.
> 
> ...
> 
> > +	struct fwnode_handle *fwnode;  
> 
> Do you need to include property.h?
> 
> ...
> 
> > +	/* get INT1 only supported interrupt or fallback to first interrupt */
> > +	fwnode = dev_fwnode(dev);  
> 
> > +	if (!fwnode)
> > +		return -ENODEV;  
> 
> Unneeded check, the below will do it for you,
> 
> > +	irq = fwnode_irq_get_byname(fwnode, "INT1");
> > +	if (irq < 0 && irq != -EPROBE_DEFER) {
> > +		dev_info(dev, "no INT1 interrupt defined, fallback to first interrupt\n");
> > +		irq = fwnode_irq_get(fwnode, 0);
> > +	}
> > +	if (irq < 0)
> > +		return dev_err_probe(dev, irq, "error missing INT1 interrupt\n");  
> 
> ...
> 
> > -	return inv_icm42600_core_probe(regmap, chip, client->irq,
> > +	return inv_icm42600_core_probe(regmap, chip,
> >  				       inv_icm42600_i2c_bus_setup);  
> 
> This is now one line (81 characters which is fine independently on your choice
> of the limit).
> 
> ...
> 
> > -	return inv_icm42600_core_probe(regmap, chip, spi->irq,
> > +	return inv_icm42600_core_probe(regmap, chip,
> >  				       inv_icm42600_spi_bus_setup);  
> 
> One line.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ