All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libnvdimm: Switch to using the new API kobj_to_dev()
@ 2020-12-21  1:39 Tian Tao
  2020-12-24 18:04 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-12-21  1:39 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, dave.jiang, ira.weiny; +Cc: linux-nvdimm

fixed the following coccicheck:
drivers/nvdimm/region_devs.c:762:60-61: WARNING opportunity for
kobj_to_dev().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/nvdimm/region_devs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index ef23119..d71d4e9 100644
--- 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)
-- 
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] libnvdimm: Switch to using the new API kobj_to_dev()
  2020-12-21  1:39 [PATCH] libnvdimm: Switch to using the new API kobj_to_dev() Tian Tao
@ 2020-12-24 18:04 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2020-12-24 18:04 UTC (permalink / raw)
  To: Tian Tao; +Cc: linux-nvdimm

On Sun, Dec 20, 2020 at 5:40 PM Tian Tao <tiantao6@hisilicon.com> wrote:
>
> fixed the following coccicheck:
> drivers/nvdimm/region_devs.c:762:60-61: WARNING opportunity for
> kobj_to_dev().
>

Thanks for this, but you missed a few:

drivers/nvdimm/bus.c:716:       struct device *dev =
container_of(kobj, typeof(*dev), kobj);
drivers/nvdimm/core.c:506:      struct device *dev =
container_of(kobj, typeof(*dev), kobj);
drivers/nvdimm/dimm_devs.c:421: struct device *dev =
container_of(kobj, typeof(*dev), kobj);
drivers/nvdimm/dimm_devs.c:537: struct device *dev =
container_of(kobj, typeof(*dev), kobj);
drivers/nvdimm/namespace_devs.c:1626:   struct device *dev =
container_of(kobj, struct device, kobj);
drivers/nvdimm/region_devs.c:647:       struct device *dev =
container_of(kobj, typeof(*dev), kobj);
drivers/nvdimm/region_devs.c:762:       struct device *dev =
container_of(kobj, struct device, kobj);

Care to resend with those included?
_______________________________________________
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-12-24 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21  1:39 [PATCH] libnvdimm: Switch to using the new API kobj_to_dev() Tian Tao
2020-12-24 18:04 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.