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/region_devs.c:762: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: 1678e493d530e7977cce34e59a86bb86f3c5631e commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_to_dev.cocci script :::::: branch date: 23 hours ago :::::: commit date: 7 months ago Please take the patch only if it's a positive warning. Thanks! region_devs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -759,7 +759,7 @@ REGION_MAPPING(31); static umode_t mapping_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 nd_region *nd_region = to_nd_region(dev); if (n < nd_region->ndr_mappings) _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
