Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp938363pxb; Wed, 3 Mar 2021 21:48:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaIw7qv2iBMdCIyuQJe2YxTzsQBKpZaBJfwZwtt4eUihRpokkXaXmYptD0W/Bb7Oci+QL2 X-Received: by 2002:aa7:c94a:: with SMTP id h10mr2624954edt.41.1614836882286; Wed, 03 Mar 2021 21:48:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614836882; cv=none; d=google.com; s=arc-20160816; b=UhtsFhZ8E+WCDRWuPy2T38txKbt/K2JQ9P8sh1a8Km+O5XnJmOW8oWRxAswHjLSQfn maWqNwGk97xo1EGzmeHTl+T0MyxhxqfM4ujuM7Mhn7vc13YrGFObg9aVUa7/ZsMi+vZE 90WbY5wKieQlclcK6BpUlWg5IFGX+aUTzp3/YRWS1JeaY8yww+3BDZC078z57TQbNN4A 0AtwahLiAyzuqO9eFGDOtuOBluKruRXr/w0JvSPAhJ4MZg2g2U0MLWsoDIKCOnG3r+qm B2BY/nvALpU8UNtc/QVr5nS2X02J6dk4uH1XTRDJtXxZZoPraiYC4kt0Hk3w8lpY3n7A cFFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TGNRinDUiJRxoWPCaKGtKr3+MQ9ft9Z83v1gGSGgJio=; b=JUmvRJfwM+eBQyPAxpio+fGrHEcPKHtD1TGvyyTfqSE+C5R2aZm8lGJO9AOTKbeZcr HVAX+rdJtOJ7arLJFEipbXuu3sxun/L5uVwSHcTKGY0LQVuiMKTgLz0tBPEtzT1tTQG3 ZId6S/ZSCzVxuabW0nIiZrQFZY49kgkj6oGVvmYthRa82GOkOyKcZkNrlRiAIMPqCE8f 9axkeHQXeEotn+3AR9mryqzHw7BugNtv+wKvWDAcgk66Z+ClBdAmVfSw/Lz2N4TQR/ig 7hxAD/csa3RNrg0mSHLBpnagDKsCN/eOLvYK9Kdhm3mrxQzSEjxzSb7nQf2tyi026Mst IpPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bJU9KzjL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si16876945edm.396.2021.03.03.21.47.40; Wed, 03 Mar 2021 21:48:02 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bJU9KzjL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836222AbhCBG72 (ORCPT + 99 others); Tue, 2 Mar 2021 01:59:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:32816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1577051AbhCBFhw (ORCPT ); Tue, 2 Mar 2021 00:37:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42A646146B; Tue, 2 Mar 2021 05:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614663431; bh=yX8R/LjOcUGHn7E8QsZIMKBDISkHQNvZsgQfi9+ryv0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bJU9KzjLHfl/9E8tw3i6NCPZFOAGdePX+61d3eg1jII1ljWgSZtPyTJE4PdPZLsIm yTUdaIRU34UV0srxahPPEbKT6xbSV4Ngr5tBi9nmHbsB+gTglBzg92bhM4qw/A8tL6 V3xC5dPHa2tDPTZvvTKtEQVqp7OBZwM4kQ8bDO0I= Date: Tue, 2 Mar 2021 06:37:06 +0100 From: Greg KH To: "tiantao (H)" Cc: Tian Tao , zbr@ioremap.net, rikard.falkeborn@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev() Message-ID: References: <1614603535-24046-1-git-send-email-tiantao6@hisilicon.com> <9be69246-fb8b-27dc-c459-0f9aa25c5c88@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9be69246-fb8b-27dc-c459-0f9aa25c5c88@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 08:51:08AM +0800, tiantao (H) wrote: > 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. Then include that in the changelog text, otherwise this looks like a warning by the complier, which it is not. > > > 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); Yes, but you made this change in only one of the hunks, and not the other. And, it is a different type of change, only do one "logical" thing per patch. This should be a 2 patch series if you care about the coding style of this driver. Please fix up and resend. thanks, greg k-h