public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: <wsa@kernel.org>
To: "tiantao (H)" <tiantao6@huawei.com>
Cc: Tian Tao <tiantao6@hisilicon.com>, <linux-i2c@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>
Subject: Re: [PATCH] i2c: Switch to using the new API kobj_to_dev()
Date: Sat, 19 Sep 2020 08:32:54 +0200	[thread overview]
Message-ID: <20200919063254.GA1044@kunai> (raw)
In-Reply-To: <0f47261e-c80e-a57f-2771-1be5e179a436@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

On Sat, Sep 19, 2020 at 09:01:12AM +0800, tiantao (H) wrote:
> 
> 
> 在 2020/9/19 5:09, wsa@kernel.org 写道:
> > 
> > >   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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-09-19  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  1:38 [PATCH] i2c: Switch to using the new API kobj_to_dev() Tian Tao
2020-09-18 21:09 ` wsa
2020-09-19  1:01   ` tiantao (H)
2020-09-19  6:32     ` wsa [this message]
2020-09-21  9:14 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200919063254.GA1044@kunai \
    --to=wsa@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=tiantao6@hisilicon.com \
    --cc=tiantao6@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox