Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1601426pxk; Fri, 18 Sep 2020 18:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxw9tsLbXAAlgOZfK1mwWAAkOS0v/VXgXcAZu5Bi+lIOZsQru5bqff7PUFR+iYDfpzbhhEO X-Received: by 2002:aa7:d30b:: with SMTP id p11mr41693248edq.80.1600477420738; Fri, 18 Sep 2020 18:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600477420; cv=none; d=google.com; s=arc-20160816; b=Q1Mc3GOPQ2T0o/ZxEWH5L13YV0bEw9cAYltfIbMY4YeHINSwmOfsnDSlkp2juRuQ/H pefv5/M29Rz762C9mo3cNF0+vLN69eZAK2CJm2VtGFUUGApKETy8rJvRhtRPuhdjF4o1 2qv/NFiB/LCPgQyh6HsY4D7k4wqRCsJcjKZHNcaH2sUu1vaXRZQx34eskaIayTwmvjcx r18C2US/8EIQXq6tKZtHyMpTxbJME0kGOtOmvPPe0MHu9gt6GYJud8f2Aq9TdhEVVcUE xPd5A++qLOi7Mm/Y9iIlBLYh5fndbmiZRoPo0Bckso7Xhm+LiNIQczB96rlqmw5CpLJk VwPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject; bh=jhbbN/7fhzeBgk425/ZIf+gVgb0RIt0s58R9yFjSCPk=; b=P9DeWCOqCIlCvHX8MQmFTn9bvYvDd7phrgqyM14357veLc/Bq/h9LxzAy0Zchw8B/s EeDAwY1GKrwGEon0veakWTmPIGmm3rBdHOy0vDlvzC4nSKUa1f3Jo7B6VqwdxiSR6VpP EeW6IT4BowHYBpzbKh7IdvKHt3pzKbAMoFCxvtHjcGYNVOId8fteCXKw9Eo1MO78KgOR p9KYT6yPDXJA92k/n9i1mRsuJ/wAtZRjt3duLkuwc6sV+J3+tusoHlWNYvYHRMN1sf9U doFxvtUJIxopv8T1n2Oyw9wNneuaR0I8tVAq3+O+j203Fz42mwOsYvGGIDUuBBM96dXb 2RKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si4500657ejl.32.2020.09.18.18.03.17; Fri, 18 Sep 2020 18:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726247AbgISBBU (ORCPT + 99 others); Fri, 18 Sep 2020 21:01:20 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55736 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726009AbgISBBU (ORCPT ); Fri, 18 Sep 2020 21:01:20 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 68FDDDC34ED5440A51EF; Sat, 19 Sep 2020 09:01:18 +0800 (CST) Received: from [127.0.0.1] (10.57.60.129) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 09:01:12 +0800 Subject: Re: [PATCH] i2c: Switch to using the new API kobj_to_dev() To: , Tian Tao , , , References: <1600133898-35883-1-git-send-email-tiantao6@hisilicon.com> <20200918210911.GF52206@kunai> From: "tiantao (H)" Message-ID: <0f47261e-c80e-a57f-2771-1be5e179a436@huawei.com> Date: Sat, 19 Sep 2020 09:01:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200918210911.GF52206@kunai> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.57.60.129] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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!