All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org,
	"Chaitanya Kulkarni" <chaitanya.kulkarni@wdc.com>,
	"Matias Bjørling" <matias.bjorling@wdc.com>
Subject: [PATCH 1/4] lightnvm: use kobj_to_dev()
Date: Tue, 13 Apr 2021 10:52:54 +0000	[thread overview]
Message-ID: <20210413105257.159260-2-matias.bjorling@wdc.com> (raw)
In-Reply-To: <20210413105257.159260-1-matias.bjorling@wdc.com>

From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

This fixs coccicheck warning:

drivers/nvme//host/lightnvm.c:1243:60-61: WARNING opportunity for
kobj_to_dev()

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
---
 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 b705988629f2..e3240d189093 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -1240,7 +1240,7 @@ static struct attribute *nvm_dev_attrs[] = {
 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;
-- 
2.25.1


  reply	other threads:[~2021-04-13 10:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 10:52 [PATCH 0/4] lightnvm pull request Matias Bjørling
2021-04-13 10:52 ` Matias Bjørling [this message]
2021-04-13 10:52 ` [PATCH 2/4] lightnvm: return the correct return value Matias Bjørling
2021-04-13 10:52 ` [PATCH 3/4] lightnvm: remove duplicate include in lightnvm.h Matias Bjørling
2021-04-13 10:52 ` [PATCH 4/4] lightnvm: deprecated OCSSD support and schedule it for removal in Linux 5.15 Matias Bjørling
2021-04-13 15:16 ` [PATCH 0/4] lightnvm pull request Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210413105257.159260-2-matias.bjorling@wdc.com \
    --to=mb@lightnvm.io \
    --cc=axboe@kernel.dk \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=matias.bjorling@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.