Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B658C433DB for ; Sat, 20 Feb 2021 09:10:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC81A64DFD for ; Sat, 20 Feb 2021 09:10:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC81A64DFD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=2jlSrql+rz1rEdQW1EvK6B8Pt2+b6tyRtREoAL06CxI=; b=uQQbxvXPU8xjM6i6qUs+WQwzMS 1pyqCgI2bXHy3qi3W3taW8Xz8AVnymSpVCZpro/eA7WywNJo5lxMsDmOuSbtWBebmGfTXD26qcDWT T4BJPXO2RwQBLSVXR/VFOFvutEIZYUeBjeA8bQffcxKB4t9XHEfUuS2pzR6ZPDuMsZsfZzizy2W6w G4MoBcXdzaGGm9iNeCv0SQlZ35KmqCXfKfXDnwAKyg/jQQtpxpbZfGypiZvGNC8CADI2HTQNzTDk2 xG5cD4/0mmF3CEv0FzOn4vvXK9C+n49oEdPus6M4MT3CtM4KE789/S/1Q9QIkmv95NQ4t0B9twUOM kgKy/X1Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDOHY-0005M5-Ln; Sat, 20 Feb 2021 09:10:32 +0000 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDOHV-0005LQ-7g for linux-nvme@lists.infradead.org; Sat, 20 Feb 2021 09:10:30 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e01424; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---0UP0Iap8_1613812219; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UP0Iap8_1613812219) by smtp.aliyun-inc.com(127.0.0.1); Sat, 20 Feb 2021 17:10:20 +0800 From: Yang Li To: kbusch@kernel.org Subject: [PATCH] nvme-core: Switch to using the new API kobj_to_dev() Date: Sat, 20 Feb 2021 17:10:18 +0800 Message-Id: <1613812218-17601-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210220_041029_506874_867316A1 X-CRM114-Status: GOOD ( 10.20 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sagi@grimberg.me, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, axboe@fb.com, Yang Li , hch@lst.de MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org fixed the following coccicheck: ./drivers/nvme/host/core.c:3440:60-61: WARNING opportunity for kobj_to_dev() ./drivers/nvme/host/core.c:3679:60-61: WARNING opportunity for kobj_to_dev() Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f13eb4d..d56590f 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3437,7 +3437,7 @@ static ssize_t nsid_show(struct device *dev, struct device_attribute *attr, static umode_t nvme_ns_id_attrs_are_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 nvme_ns_ids *ids = &dev_to_ns_head(dev)->ids; if (a == &dev_attr_uuid.attr) { @@ -3676,7 +3676,7 @@ static DEVICE_ATTR(reconnect_delay, S_IRUGO | S_IWUSR, static umode_t nvme_dev_attrs_are_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 nvme_ctrl *ctrl = dev_get_drvdata(dev); if (a == &dev_attr_delete_controller.attr && !ctrl->ops->delete_ctrl) -- 1.8.3.1 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme