Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp451090pxa; Fri, 14 Aug 2020 08:30:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1Vgo8qseHvtmo95ns9sxPn+amGwzyA80nPx5rx9dfhUJbIHgP5yzuu8Fn89bTnKK+B08J X-Received: by 2002:aa7:c6c2:: with SMTP id b2mr2857948eds.173.1597419001849; Fri, 14 Aug 2020 08:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597419001; cv=none; d=google.com; s=arc-20160816; b=Y4ABLKz7pW2cgm3KEsqTrwtUDMMm9sWV1rfvCoBWKT5pb4yaavp5s/13Yak1XTlqVs NGdeR9I7gsaFNYLdoT1a/N0fsRMhwobdZ9tYob0genGSWMCcQXgffOfeqnD/NT1jmAjc pPgBrLLcP8QasJkODdeBbPKV8jqlnFWggsB3inaqtFTS41s/guvf+nHykg7ndngfqaTb mMMyipeOf6uTcZ+R1eJxlz68UZZjCccYqlKgiNsxmfrWROHEETsWvuLaF7ahaf6FkcYd /hN0anzd6u4hhYjh9KHGAwV17acZcEhadBxYVjdtSbpcL50bmfuG4LZwPEj0bKqtnCu8 6KTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=vBVBMvKKxks/kGkJ4ndBszEEsQk9CsCHA7aFPfw0OnY=; b=vS+g/4+7JkjUq4cSxN0QXgKvg/HsBhsY+bTTM1bscYC8Yar5knJF47Tepp5gdz+ROe RTYYrs+wT14xbcAdr+JLSZt9NCmcW6K4YHIGuxLidfS1Fis+Z+/4p5CRpeHeERU5kC8p 726fjKZe9jPW3qX+RHeQY8QkeyIlzRfCKXc/uzjl03ydzqZUhXDGR9i6FAXqFNrFdqNm 8QGd7c6UBpb4+CK0HxlZWkR6pzgYUQ8fN9Qgu4eTAkrqYV6fgB81Nivvu48YoZbNqa0d RNDZt7GJjIT5wNE5vcJqNJ8YgjqYw8vZKjZYUCJooY6aVSOV9wEXJtyLlCuGlfu/bQbK 2VxA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si5403281edv.605.2020.08.14.08.29.38; Fri, 14 Aug 2020 08:30:01 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgHNP3H (ORCPT + 99 others); Fri, 14 Aug 2020 11:29:07 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:32910 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbgHNP3E (ORCPT ); Fri, 14 Aug 2020 11:29:04 -0400 Received: by mail-ot1-f67.google.com with SMTP id t7so7876482otp.0; Fri, 14 Aug 2020 08:29:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vBVBMvKKxks/kGkJ4ndBszEEsQk9CsCHA7aFPfw0OnY=; b=ZiGghja38wB46vjSAhPbNDcDO67HuzxVsxaTnxsqrwYqpappI5vA74zYA8elDpnbHO b6eolEASrnyrgCDCS+7HKZQtyNuFJQPEk0ITo5flWZb0FaE6R9qTkC+hIDScY7ODWr+V Rtp7UVzhzmQOd0ZcdfTXEdIoCe/H5/m46pGNNci3+xQtZ4SU4R4lNeOCSFyUGCs/os9c PYOraUS+bKHElG91GQF9qbMLfJDyZeymRRxyzNgvohqJL1GJ4bc9Ua1OT4xUNJ2u5qAV 4DeBr/p5w+s8t95VpFb5i9v8DDm4bFy1euWoKMt9loO+x83L4JVoY3k2aZ6/xhZeSVPP 4QCQ== X-Gm-Message-State: AOAM533fuZLW30hpxtL7P76Y1ruhROffX6yKCpvyiPPeIfu3gG2ouafR qUOwRU61GgZjfshUY77aq62JKG5akJZgQiCrBbg= X-Received: by 2002:a05:6830:1c74:: with SMTP id s20mr2165582otg.167.1597418944007; Fri, 14 Aug 2020 08:29:04 -0700 (PDT) MIME-Version: 1.0 References: <1597286952-5706-1-git-send-email-wangqing@vivo.com> In-Reply-To: <1597286952-5706-1-git-send-email-wangqing@vivo.com> From: "Rafael J. Wysocki" Date: Fri, 14 Aug 2020 17:28:52 +0200 Message-ID: Subject: Re: [PATCH] acpi/nfit: Use kobj_to_dev() instead To: Wang Qing , Dan Williams Cc: Vishal Verma , Dave Jiang , Ira Weiny , "Rafael J. Wysocki" , Len Brown , "linux-nvdimm@lists.01.org" , ACPI Devel Maling List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 4:54 AM Wang Qing wrote: > > Use kobj_to_dev() instead of container_of() > > Signed-off-by: Wang Qing LGTM Dan, any objections? > --- > drivers/acpi/nfit/core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > index fa4500f..3bb350b > --- a/drivers/acpi/nfit/core.c > +++ b/drivers/acpi/nfit/core.c > @@ -1382,7 +1382,7 @@ static bool ars_supported(struct nvdimm_bus *nvdimm_bus) > > static umode_t nfit_visible(struct kobject *kobj, struct attribute *a, int n) > { > - struct device *dev = container_of(kobj, struct device, kobj); > + struct device *dev = kobj_to_dev(kobj); > struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev); > > if (a == &dev_attr_scrub.attr && !ars_supported(nvdimm_bus)) > @@ -1667,7 +1667,7 @@ static struct attribute *acpi_nfit_dimm_attributes[] = { > static umode_t acpi_nfit_dimm_attr_visible(struct kobject *kobj, > struct attribute *a, int n) > { > - struct device *dev = container_of(kobj, struct device, kobj); > + struct device *dev = kobj_to_dev(kobj); > struct nvdimm *nvdimm = to_nvdimm(dev); > struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); > > -- > 2.7.4 >