Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp919157pxa; Wed, 19 Aug 2020 19:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv/upUEmbvlby3xSyrKz4cn0mUBVpAPPnzGPO8ReJgXldkNGkoGiSgJqkJIuY67r2e3Qd0 X-Received: by 2002:a17:906:84cf:: with SMTP id f15mr1280405ejy.259.1597892057137; Wed, 19 Aug 2020 19:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597892057; cv=none; d=google.com; s=arc-20160816; b=tIGiMjc02j0tk0CFX709xoh3j8IOJOLpslsmjnL1fQX8p2nKB7hMIwvTRVz38NC3u3 OimAQ1q3vlSsiN6kBchXdlbz1UVNpEh9p2HeC17s08kQrnIRVIFcLNnT2v4ng8RuL64o 90XszTCswVpaQ8CpwdtHtqTXkzEfC60O04tRkTZueZSJvbOizAKThEEYG34o6NQ8/lOg CxSe7eImhd4Tz5e3NjNy+1F7PYLNVxBut7YEHd8rzBkQCJGIo+ex2Yo/316TSqPeTrjK f4AdsLmEq6m/QATmuUK+R8hmzBFmBsNpP3A5quQwJJZm91uQv1b9L6lr97XoUi/NyyTl Ag8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dTjeEry3Z8Fh3i/QDk2u2z0zWnHEpNGthQeGER8z6Fo=; b=Sf3evQh9BKTmwWLcgdjrCZ0w/MuDU7r6UTm0xLSH9Zc33cPwE0v6BJpIxi5f1a3lsI d7zDMFRDfoO4F7F04VsZGkcT4UNoDSmBnICpS6njzLK/Kx3xTXvFeceUTaJ3Mb+67xbf Klb5rchy6stB5BY4qyvZ+kCSwVFuPMz6qctvgw0DlC+n9WUg5xHLa7lwFO87QeTSjGMq WXdwpTzq/ITt0euIKA5pPVpofRQSMCpP2OH3cgT7ortgCNoH6PsS5f63wPjK5+upIAvn WMmRGYW9smDWfoUqG5xVPUOakaTH7WiAjrC7LFJbmU0XPqoQHa8YjbounVC/hnLcgBeI GX2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tkpMz1rm; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si362561ejc.225.2020.08.19.19.53.53; Wed, 19 Aug 2020 19:54:17 -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; dkim=pass header.i=@linaro.org header.s=google header.b=tkpMz1rm; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgHTCxO (ORCPT + 99 others); Wed, 19 Aug 2020 22:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgHTCxN (ORCPT ); Wed, 19 Aug 2020 22:53:13 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46824C061757 for ; Wed, 19 Aug 2020 19:53:13 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id mt12so332627pjb.4 for ; Wed, 19 Aug 2020 19:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=dTjeEry3Z8Fh3i/QDk2u2z0zWnHEpNGthQeGER8z6Fo=; b=tkpMz1rmHr/pt399a5d5omZYUPrk7oM/oKyiK1XH05m3swD5Hw3jfnJNU0fAw7bMtx KrXhIVQys9OUUPnW6K2t22hoRs9PVENwAT80Ja8TBD6hZcrp7LuQ7LMeKBQNqI3khVsD FLwXoEjfwFWXQz52rGzcbAwBQmfrYxY6ZzlrMFEbk3KpACcrc8s88FAt7h5fmmutooiq 8g7pnSY8moFCNA+xP642snZ1zS31jjOlKHvWkJ5OcskZn01wIbEjCnD1bnLalOTR9M7r fdlIvqzJO5GLmvW7kZ7bX8Dhq3b5kF8M6TDh0lrwF9f47aYXphptiFGCCmWaq6SM4CvW R4HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=dTjeEry3Z8Fh3i/QDk2u2z0zWnHEpNGthQeGER8z6Fo=; b=KDFI6Gi9pPD799JmtXMGLLSzRo3RaTmImN9pkvldf3KJmh23DVwhsqP44qRwukU+jc LzmV8raP8QB+gkKJllquSfFkey9VSpEzv4REk7cw054ImQgPmkhrYJeM9e46vhb+VtqP q1SKPi/37llu9n37nvhUQ2JYXXgROWRjsxlz8Jn+Q5lVdgIel+eRYT3PNBEhYm0jvo2P jOH+AeaSIJOCKEA8pcqYDwFZW6bXLUDEEvwnrBOOhL0M7h7zWNXWGxSr+cRa510OYRnM zpfk14OHMk7tnWrskIYRE9ubfdT8afY2tXXpyI1wTcCGkzT68U3b4Pc2ONju1vaWrexR 7AwA== X-Gm-Message-State: AOAM533/sZ94DuCWKNK634KUMOEfniUzc0B9vW9R+9dYCq4AYyYUYAoo /jxuhvPaoLSof58fAaEET0yNwJBmxwHy8g== X-Received: by 2002:a17:90a:5b:: with SMTP id 27mr687730pjb.188.1597891992048; Wed, 19 Aug 2020 19:53:12 -0700 (PDT) Received: from ?IPv6:240e:362:440:ee00:a151:c520:3d27:43bb? ([240e:362:440:ee00:a151:c520:3d27:43bb]) by smtp.gmail.com with ESMTPSA id u191sm533990pgu.56.2020.08.19.19.53.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Aug 2020 19:53:11 -0700 (PDT) Subject: Re: [PATCH] uacce: Use kobj_to_dev() instead of container_of() To: Tian Tao , wangzhou1@hisilicon.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: linuxarm@huawei.com References: <1597889792-53139-1-git-send-email-tiantao6@hisilicon.com> From: Zhangfei Gao Message-ID: <9f2bbd04-79fa-95e6-50ec-e0dd270f6c61@linaro.org> Date: Thu, 20 Aug 2020 10:52:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1597889792-53139-1-git-send-email-tiantao6@hisilicon.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/20 上午10:16, Tian Tao wrote: > Use kobj_to_dev() instead of container_of() > > Signed-off-by: Tian Tao > Reviewed-by: Zhou Wang Acked-by: Zhangfei Gao Thanks > --- > drivers/misc/uacce/uacce.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c > index a5b8dab..a9da7b1 100644 > --- a/drivers/misc/uacce/uacce.c > +++ b/drivers/misc/uacce/uacce.c > @@ -370,7 +370,7 @@ static struct attribute *uacce_dev_attrs[] = { > static umode_t uacce_dev_is_visible(struct kobject *kobj, > struct attribute *attr, int n) > { > - struct device *dev = container_of(kobj, struct device, kobj); > + struct device *dev = kobj_to_dev(kobj); > struct uacce_device *uacce = to_uacce_device(dev); > > if (((attr == &dev_attr_region_mmio_size.attr) &&