Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp933398pxb; Wed, 3 Mar 2021 21:36:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLxkhQIsoDbKdUxi/F7lWWeKHb01nCQO02x5G1QjFMJvpBSHslqj+yhXVaVy5QntICD3Fh X-Received: by 2002:a17:906:66cc:: with SMTP id k12mr2303830ejp.382.1614836160940; Wed, 03 Mar 2021 21:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614836160; cv=none; d=google.com; s=arc-20160816; b=UEnF30WPfoxZ6ivdT0AWZme3a05nstdrhzRUTe3YS7hWR90b/+KEv383PgYyUkp4LH 6YgmtZt3suV1+z5SSo6j+bAzjEJYtDS6wQMIV1Lput/APuMsfgMI2xNfmpl6KHJbrbm5 3xo4RuWvsO7vJM7aQff0PF4w8xN4uUsFschuXr3PqgmIh9an0i/pEXSFBzsU1ULZiLFM W5kq39JBrFnNQalFpmt2U9GDAwBqH8QQiu+yci8Ep81ggeTFYeamQT6ZOHcCHSzDZoR6 8hdd2cNWE/xItKYXy/VqFz1oFEBj4IFlwewSB5o4qO2U4trCH4REGVLhsWgJXVNV6Pvz F57A== 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:cc:to :subject; bh=Kz89Ddr9gzL+OotcmcLxrOwWPsHETV+/5Z+THWgSaZ0=; b=yYxMzsO57BPRLQ/2yF+2W6VazRjIamW2pi+XbfyxhTSyDnUQaafq6uo/jVcPWgaa0e EnlTDoI5K5LpWwR4I/YaVoBE92mAJCXnuxtQaH0x1IyMTtt6H3CPMJt03/pjkifaK7eg +tfepo/kiQEtFkd+9dSda3u748wucDKy0NjL9vp9lFVVOkelkCD4GHtRDJgk6RFMAne5 C1RgSqCEP1rAnpOcM3GlSDVWrm1ARsvfZTHjMlYOJy8CXjFlR4Z2OEM+AZBjVVWm3px9 lMOnQc29FuqPxntAJs2gi6SDpvRbKW/rCqL7n6BgVKF/grpjFCk+XRoPa10mdvFd7Omy Powg== 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 lr15si13517289ejb.275.2021.03.03.21.35.38; Wed, 03 Mar 2021 21:36:00 -0800 (PST) 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 S1576194AbhCBE0A (ORCPT + 99 others); Mon, 1 Mar 2021 23:26:00 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:13016 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234662AbhCBAwU (ORCPT ); Mon, 1 Mar 2021 19:52:20 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DqJS20nb5zjV6q; Tue, 2 Mar 2021 08:49:38 +0800 (CST) Received: from [127.0.0.1] (10.40.188.144) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 2 Mar 2021 08:51:09 +0800 Subject: Re: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev() To: Greg KH , Tian Tao CC: , , References: <1614603535-24046-1-git-send-email-tiantao6@hisilicon.com> From: "tiantao (H)" Message-ID: <9be69246-fb8b-27dc-c459-0f9aa25c5c88@huawei.com> Date: Tue, 2 Mar 2021 08:51:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.40.188.144] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi: 在 2021/3/1 21:09, Greg KH 写道: > On Mon, Mar 01, 2021 at 08:58:55PM +0800, Tian Tao wrote: >> fix the below warnning: >> /drivers/w1/slaves/w1_ds2780.c:93:60-61: WARNING opportunity for >> kobj_to_dev() > What creates that warning? This is reported by coccicheck. > > >> Signed-off-by: Tian Tao >> --- >> drivers/w1/slaves/w1_ds2780.c | 3 ++- >> drivers/w1/slaves/w1_ds2781.c | 2 +- >> 2 files changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c >> index c281fe5..3cde1bb 100644 >> --- a/drivers/w1/slaves/w1_ds2780.c >> +++ b/drivers/w1/slaves/w1_ds2780.c >> @@ -90,7 +90,8 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj, >> struct bin_attribute *bin_attr, char *buf, >> loff_t off, size_t count) >> { >> - struct device *dev = container_of(kobj, struct device, kobj); >> + struct device *dev = kobj_to_dev(kobj); >> + > Why the extra line here, but not in the other chunk? This is reported by checkpatch. tiantao@ubuntu:~/mailline/linux-next$ ./scripts/checkpatch.pl drivers/w1/slaves/w1_ds2780.c WARNING: Missing a blank line after declarations #94: FILE: drivers/w1/slaves/w1_ds2780.c:94: +       struct device *dev = kobj_to_dev(kobj); +       return w1_ds2780_io(dev, buf, off, count, 0); > > Consistancy is key :) > > Please fix up. > > thanks, > > greg k-h > . >