lkml.org 
[lkml]   [2019]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 7/7] backlight: gpio: use a helper variable for &pdev->dev
On Tue, Jul 23, 2019 at 08:29:52AM +0200, Bartosz Golaszewski wrote:
> pon., 22 lip 2019 o 18:09 Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> napisał(a):
> >
> > On Mon, Jul 22, 2019 at 05:03:02PM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > >
> > > Instead of dereferencing pdev each time, use a helper variable for
> > > the associated device pointer.
> >
> > > static int gpio_backlight_probe(struct platform_device *pdev)
> > > {
> > > - struct gpio_backlight_platform_data *pdata =
> > > - dev_get_platdata(&pdev->dev);
> > > + struct gpio_backlight_platform_data *pdata;
> > > struct backlight_properties props;
> > > struct backlight_device *bl;
> > > struct gpio_backlight *gbl;
> > > enum gpiod_flags flags;
> > > + struct device *dev;
> >
> > Can't we do
> >
> > struct device dev = &pdev->dev;
> > struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev);
> >
> > ? It fits 80 nicely.
> >
>
> IMO it's more readable like that with the reverse christmas tree layout.

It makes more churn in the original code and for initializers the order is
defined by its nature.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2019-07-23 17:35    [W:0.061 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site