lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()
On Thu, Aug 20, 2020 at 4:05 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Aug 20, 2020 at 12:10 PM Alexandru Ardelean
> <ardeleanalex@gmail.com> wrote:
> > On Thu, Aug 20, 2020 at 6:04 AM Tian Tao <tiantao6@hisilicon.com> wrote:

> > > - struct device *dev = container_of(kobj, struct device, kobj);
> > > + struct device *dev = kobj_to_dev(kobj);

> And now this can be one line since dev is not used separately.

On the other hand perhaps one object per line is better to read.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-08-20 15:08    [W:0.055 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site