All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
@ 2020-08-21  1:19 Tian Tao
  2020-08-21  2:37   ` Bart Van Assche
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Tian Tao @ 2020-08-21  1:19 UTC (permalink / raw)
  To: mst, jasowang, pbonzini, stefanha, axboe, virtualization, linux-block
  Cc: linuxarm

Use kobj_to_dev() instead of container_of()

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

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 63b213e0..eb367b5 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -631,7 +631,7 @@ static struct attribute *virtblk_attrs[] = {
 static umode_t virtblk_attrs_are_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 gendisk *disk = dev_to_disk(dev);
 	struct virtio_blk *vblk = disk->private_data;
 	struct virtio_device *vdev = vblk->vdev;
-- 
2.7.4


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

end of thread, other threads:[~2020-08-21 14:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21  1:19 [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of() Tian Tao
2020-08-21  2:37 ` Bart Van Assche
2020-08-21  2:37   ` Bart Van Assche
2020-08-21  8:14 ` Stefano Garzarella
2020-08-21  8:14   ` Stefano Garzarella
2020-08-21 11:11 ` Stefan Hajnoczi
2020-08-21 11:11   ` Stefan Hajnoczi
2020-08-21 14:45 ` Jens Axboe
2020-08-21 14:45   ` Jens Axboe

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.