Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4108pxb; Tue, 2 Mar 2021 17:08:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlnfm+taSxa1G499nHuymZgfIMyrBsuPrGA+rgNljnEEKE7pNzdWVP3+5fZzPv3jnSdLOf X-Received: by 2002:a17:906:9386:: with SMTP id l6mr22886005ejx.455.1614733718609; Tue, 02 Mar 2021 17:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614733718; cv=none; d=google.com; s=arc-20160816; b=KtQ3kliCng79Cz2rdPRF/eDs83piwcb2nU0tLux9qvObbNFICi7tFiCb2Uh3Dx/Wpy Vu/8I457e2eCJrAHhE4EfnkVIIvA3SP89jwWpch5kIZ1y03a6IgSpo/+9DdcaL3d3OWr A0NdcB4bBIGVUu6LVq9CY4wzEB5wXx4SIbsNE2tVoBrimR/X8K0COL7cgu7sUF3KjHps 3Hx88IIU0NtIdne0DWuQDoUICniBAOBukA+doGg1512I1YTwFndF/v2qy1I1a2mLSAmr 5wUl2laYUABcyhxjYwsmAwVM4c1Ebv9X0SjLlfXb0/LgPyvpvPiQAneNF0MIQTNmriN7 KV2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=4zPCzxM+7ZWFsF83rPGh9HqNfHPg8JROfM40iz9u/s4=; b=qzy6wsxiS+dPHsXIRl7ByIqUJJ5qHCRVJcVWFBmWxfIM4aHjgTgpUXkG0mW8y6lvkR BF66cSbumPzikIrv5CN7/oGXfDdaCxpBJ3YKT9LHDOk2XJBW8Uig4dngcBtOjYqDj9AL D31p1D30X/e8vSqF9dVToVQiLWmm5ND8mbDndT5InaJZHEDOHyt7l6oAPhCRM7o8VnJm 5uICLqghwrhrKpYPp39Tx+512IWi0AL0QdvKJ9xq5xWvew73w3rdDqZrrtOcStPnu9Ci 24CRdwYaV5Wegpr8pnYODk0xW7BNkYPQp3pNw7tciPOvFX1FhPv/obxOPdy6FVCIXOhH YYNQ== 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si14605465ejc.368.2021.03.02.17.08.16; Tue, 02 Mar 2021 17:08:38 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232855AbhCAIV4 (ORCPT + 99 others); Mon, 1 Mar 2021 03:21:56 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:36187 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232849AbhCAIVz (ORCPT ); Mon, 1 Mar 2021 03:21:55 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UPvxPBj_1614586871; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UPvxPBj_1614586871) by smtp.aliyun-inc.com(127.0.0.1); Mon, 01 Mar 2021 16:21:12 +0800 From: Yang Li To: kbusch@kernel.org Cc: axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] lightnvm: Switch to using the new API kobj_to_dev() Date: Mon, 1 Mar 2021 16:21:09 +0800 Message-Id: <1614586869-1479-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fixed the following coccicheck: ./drivers/nvme/host/lightnvm.c:1243:60-61: WARNING opportunity for kobj_to_dev() Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index b705988..e3240d1 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -1240,7 +1240,7 @@ static ssize_t nvm_dev_attr_show_20(struct device *dev, static umode_t nvm_dev_attrs_visible(struct kobject *kobj, struct attribute *attr, int index) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gendisk *disk = dev_to_disk(dev); struct nvme_ns *ns = disk->private_data; struct nvm_dev *ndev = ns->ndev; -- 1.8.3.1