Re: [PATCH v2 1/6] i2c: designware-pci: Use temporary variable for struct device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 15, 2021 at 09:51:10AM +0200, Jarkko Nikula wrote:
> On 12/13/21 20:00, Andy Shevchenko wrote:
> > Use temporary variable for struct device to make code neater.

...

> > +	dev->suspended = true;
> > +	dev->disable(dev);
> In my opinion this brings more mess than removes. If I see dev->something
> I'll immediatelly think "struct device" and get confused. x_dev->something
> or dev_y->something not so much. And this change adds in my opinion more
> confusion than removes.

Either way it will be inconsistent. If you wish to fix, I can build something
on top of your fix, but currently I drop this patch.

> >   	if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers)) {
> > -		dev_err(&pdev->dev, "%s: invalid driver data %ld\n", __func__,
> > -			id->driver_data);
> > +		dev_err(d, "%s: invalid driver data %ld\n", __func__, id->driver_data);
> >   		return -EINVAL;
> 
> Honestly, what's is the value of this change?

What is the value of the changes in general? :-)

> Yet another differently named
> "device" pointer more to the mess (Inconsistent naming use of struct
> dw_i2c_dev *dev, struct dw_i2c_dev *i_dev and struct device *dev in the
> i2c-designware-*).

As I said, please fix this inconsistency yourself how you find it better
and I will use that in the future contributions.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux