Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3233232pxb; Mon, 1 Mar 2021 05:12:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0PST2OM3iGPqELubqXaiRR4q8h0Hy8x7c9iH6ZPekh9xGCyArz+bmuuUDwBtnuB3XJ6Ka X-Received: by 2002:a50:e1c4:: with SMTP id m4mr16373551edl.182.1614604349534; Mon, 01 Mar 2021 05:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614604349; cv=none; d=google.com; s=arc-20160816; b=bZZUeFbURw2RisLVBDAy2Bj+voZkZjrmJDfOesWtVpRtaVtyTfnFltndzjA6cVS+Sz /rDkb1Ew1HXCWTwmpngeyEwxtMIyJI7QZj/EVzNsQgB8svekzAItfROhlYK+F0hT4fEs XaEc4MJ1W8Qq8MJFLqrLQIxXKXIPXSO0Ad7JMlPOVQHzkiWs1KtS0SyjoQ19mqgmFFO9 4ytItW8VJSareS0DBGV5pvHskuzjkX86vxy2zjJZrEP4p1qLjHBYBz8bnzQ+Gn0uzCDP idnIIP0HisWiZNot/PEfZa2TmCDc8wfeBVBLBB5xm9FIakcD5dsXdSMv2IeeO0wt7DId 4+EA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4Kq6SkCrbCKdfVqovmavluAxBdlsEPBCIQQBwMtydBY=; b=bHh/giyo1yfb5T6bQaoUqtR1miITTBf1DurbHLF1ySYgRmmSKI/jIE2fwI6pwv8O3S g4PxFBr/QUbkIPI0SFxVYlXo7I0OdMg/jQJuhdoyMzSvU4qYL0Y36rAhpTTh8S5XFw00 3dg/cfnD9pbeF1Yidy1J/YSIScmLquS36JYbyr05ctM54rDA0U0dIlF3PwJ3640lRhpB oBa3Fs/x0ABAO9uv7NvnQ3ririQH12XogvNH78i2KpUC9bPudsxnf22xt4NVKnW3gYAF aCnkuvtFKg+wUBDiQShvmR1rTmEuJkAwkdHMHKDc/PIJlD6opFvXqCdrfhUrZJq9tTol rOhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jHe+pYng; 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 g9si11575802ejo.224.2021.03.01.05.12.06; Mon, 01 Mar 2021 05:12:29 -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=jHe+pYng; 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 S235465AbhCANLb (ORCPT + 99 others); Mon, 1 Mar 2021 08:11:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:56906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235453AbhCANJ6 (ORCPT ); Mon, 1 Mar 2021 08:09:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 59EBE64E2E; Mon, 1 Mar 2021 13:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614604157; bh=T+hhysKQC9LROCAdI8japk0NWNbd5NQFRpUTk664/YE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jHe+pYngJUi587avuPg2AS3QqWdziewtFu613R/rXvkpUZnWMMp0hsQlGEFW6nWOB NGnwCydGH5wnBavXxlP7GvMlY5aZZwFojo1LM4x/4pEqLZ7dQnVc2CP4iKqHtSAZLX S6qoEVLrSqBBpFf4VqDRDymQ5b3BtJ6AoUkIxnOo= Date: Mon, 1 Mar 2021 14:09:15 +0100 From: Greg KH To: Tian Tao Cc: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614603535-24046-1-git-send-email-tiantao6@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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? Consistancy is key :) Please fix up. thanks, greg k-h