Re: [PATCH] i2c: Switch to using the new API kobj_to_dev()

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

 



On Sat, Sep 19, 2020 at 09:01:12AM +0800, tiantao (H) wrote:
> 
> 
> 在 2020/9/19 5:09, wsa@xxxxxxxxxx 写道:
> > 
> > >   static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
> > >   {
> > > -	struct device * const dev = container_of(kobj, struct device, kobj);
> > > +	struct device * const dev = kobj_to_dev(kobj);
> > >   	return to_i2c_client(dev);
> > 
> > Can't we make this a oneliner then merging the last two lines?
> > 
> I think two lines have better readability, and if you prefer one line, I can
> send v2 to fix that!

I just found d75d53cd571c ("i2c: Fix sparse warning in i2c.h"), so we
should leave the two lines. Thanks!

Attachment: signature.asc
Description: PGP signature


[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