linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dax: Use kobj_to_dev() instead of container_of()
@ 2020-08-31  1:32 Tian Tao
  2020-08-31 16:55 ` Ira Weiny
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-08-31  1:32 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, dave.jiang, linux-nvdimm; +Cc: linuxarm

Use kobj_to_dev() instead of container_of()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/dax/bus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 092112b..9464b56 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -474,7 +474,7 @@ static DEVICE_ATTR_WO(delete);
 static umode_t dax_region_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 dax_region *dax_region = dev_get_drvdata(dev);
 
 	if (is_static(dax_region))
@@ -1225,7 +1225,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);
 	struct dax_region *dax_region = dev_dax->region;
 
-- 
2.7.4
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dax: Use kobj_to_dev() instead of container_of()
  2020-08-31  1:32 [PATCH] dax: Use kobj_to_dev() instead of container_of() Tian Tao
@ 2020-08-31 16:55 ` Ira Weiny
  0 siblings, 0 replies; 2+ messages in thread
From: Ira Weiny @ 2020-08-31 16:55 UTC (permalink / raw)
  To: Tian Tao; +Cc: linux-nvdimm, linuxarm

On Mon, Aug 31, 2020 at 09:32:45AM +0800, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/dax/bus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 092112b..9464b56 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -474,7 +474,7 @@ static DEVICE_ATTR_WO(delete);
>  static umode_t dax_region_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 dax_region *dax_region = dev_get_drvdata(dev);
>  
>  	if (is_static(dax_region))
> @@ -1225,7 +1225,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);
>  	struct dax_region *dax_region = dev_dax->region;
>  
> -- 
> 2.7.4
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-31 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31  1:32 [PATCH] dax: Use kobj_to_dev() instead of container_of() Tian Tao
2020-08-31 16:55 ` Ira Weiny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).