CC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Dan Williams <[email protected]>
CC: Vishal Verma <[email protected]>
CC: Dave Jiang <[email protected]>
CC: Ira Weiny <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/nvdimm/namespace_devs.c:1626:60-61: WARNING opportunity for 
kobj_to_dev()


 Use kobj_to_dev() instead of container_of()

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

Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script")
CC: Denis Efremov <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   09162bc32c880a791c6c0668ce0745cf7958f576
commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add 
kobj_to_dev.cocci script
:::::: branch date: 13 hours ago
:::::: commit date: 3 months ago

Please take the patch only if it's a positive warning. Thanks!

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

--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1623,7 +1623,7 @@ static struct attribute *nd_namespace_at
 static umode_t namespace_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);
 
        if (a == &dev_attr_resource.attr && is_namespace_blk(dev))
                return 0;
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to