drivers/dax/bus: Use kobj_to_dev() API
PATCH 1/1 drivers/dax/bus: Use kobj_to_dev() API
Use kobj_to_dev() API instead of container_of().
Signed-off-by Shuai He <[email protected]>
--- drivers/dax/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dax/bus.c +1 -1
@@ -331,7 +331,7 @@ static DEVICE_ATTR_RO(numa_node);static umode_t dev_dax_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 dev_dax *dev_dax =to_dev_dax (dev);if (a == &dev_attr_target_node.attr &&dev_dax_target_node (dev_dax) <0 )
Signature · 4 lines
2.7.4 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 3 lines · Shuai He
Use
kobj_to_dev()API instead ofcontainer_of().Signed-off-by Shuai He <[email protected]>
Seems reasonable:
Reviewed-by Ira Weiny <[email protected]>
Quoted 22 lines
--- drivers/dax/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dax/bus.c +1
-1@@ -331,7 +331,7 @@ static DEVICE_ATTR_RO(numa_node);static umode_t dev_dax_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 dev_dax *dev_dax =to_dev_dax (dev);if (a == &dev_attr_target_node.attr &&dev_dax_target_node (dev_dax) <0 )Signature · 4 lines
2.7.4 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 12 lines
Use
kobj_to_dev()API instead ofcontainer_of().Signed-off-by Shuai He <[email protected]>--- drivers/dax/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dax/bus.c +0
-0
drivers/dax/bus.c static DEVICE_ATTR_RO(numa_node); · line 337
Quoted 8 lines
drivers/dax/bus.c +1
-1@@ -331,7 +331,7 @@ static DEVICE_ATTR_RO(numa_node);static umode_t dev_dax_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 dev_dax *dev_dax =to_dev_dax (dev);if (a == &dev_attr_target_node.attr &&dev_dax_target_node (dev_dax) <0 )
Reviewed-by Pankaj Gupta <[email protected]>