public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
@ 2020-08-27 20:13 Julia Lawall
  2020-08-27 22:24 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2020-08-27 20:13 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	linux-nvme, linux-kernel
  Cc: Denis Efremov, kbuild-all

Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head:   a2fc3718bc22e85378085568ecc5765fb28cabce
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/3] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago

 lightnvm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -1241,7 +1241,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;

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <13cd8bf4-06f9-04d7-e923-c397c506e8cc@web.de>]
[parent not found: <CGME20200826205412eucas1p16c748e9d73f4cd924aae1d6386ab450c@eucas1p1.samsung.com>]

end of thread, other threads:[~2020-09-08 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-27 20:13 [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Julia Lawall
2020-08-27 22:24 ` Jens Axboe
     [not found] <13cd8bf4-06f9-04d7-e923-c397c506e8cc@web.de>
2020-08-27 20:05 ` Julia Lawall
     [not found] <CGME20200826205412eucas1p16c748e9d73f4cd924aae1d6386ab450c@eucas1p1.samsung.com>
2020-08-26 20:54 ` Julia Lawall
2020-09-08 11:37   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox