* [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
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
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 8:14 ` Stefano Garzarella
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Bart Van Assche @ 2020-08-21 2:37 UTC (permalink / raw)
To: Tian Tao, mst, jasowang, pbonzini, stefanha, axboe,
virtualization, linux-block
Cc: linuxarm
On 2020-08-20 18:19, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
@ 2020-08-21 2:37 ` Bart Van Assche
0 siblings, 0 replies; 9+ messages in thread
From: Bart Van Assche @ 2020-08-21 2:37 UTC (permalink / raw)
To: Tian Tao, mst, jasowang, pbonzini, stefanha, axboe,
virtualization, linux-block
Cc: linuxarm
On 2020-08-20 18:19, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
2020-08-21 1:19 [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of() Tian Tao
@ 2020-08-21 8:14 ` Stefano Garzarella
2020-08-21 8:14 ` Stefano Garzarella
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Stefano Garzarella @ 2020-08-21 8:14 UTC (permalink / raw)
To: Tian Tao
Cc: mst, jasowang, pbonzini, stefanha, axboe, virtualization,
linux-block, linuxarm
On Fri, Aug 21, 2020 at 09:19:15AM +0800, Tian Tao wrote:
> 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
>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Thanks,
Stefano
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
@ 2020-08-21 8:14 ` Stefano Garzarella
0 siblings, 0 replies; 9+ messages in thread
From: Stefano Garzarella @ 2020-08-21 8:14 UTC (permalink / raw)
To: Tian Tao
Cc: axboe, mst, linuxarm, virtualization, linux-block, stefanha, pbonzini
On Fri, Aug 21, 2020 at 09:19:15AM +0800, Tian Tao wrote:
> 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
>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Thanks,
Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
2020-08-21 1:19 [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of() Tian Tao
@ 2020-08-21 11:11 ` Stefan Hajnoczi
2020-08-21 8:14 ` Stefano Garzarella
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2020-08-21 11:11 UTC (permalink / raw)
To: Tian Tao
Cc: mst, jasowang, pbonzini, axboe, virtualization, linux-block, linuxarm
[-- Attachment #1: Type: text/plain, Size: 311 bytes --]
On Fri, Aug 21, 2020 at 09:19:15AM +0800, Tian Tao wrote:
> 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(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
@ 2020-08-21 11:11 ` Stefan Hajnoczi
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2020-08-21 11:11 UTC (permalink / raw)
To: Tian Tao; +Cc: axboe, mst, linuxarm, virtualization, linux-block, pbonzini
[-- Attachment #1.1: Type: text/plain, Size: 311 bytes --]
On Fri, Aug 21, 2020 at 09:19:15AM +0800, Tian Tao wrote:
> 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(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
2020-08-21 1:19 [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of() Tian Tao
@ 2020-08-21 14:45 ` Jens Axboe
2020-08-21 8:14 ` Stefano Garzarella
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2020-08-21 14:45 UTC (permalink / raw)
To: Tian Tao, mst, jasowang, pbonzini, stefanha, virtualization, linux-block
Cc: linuxarm
On 8/20/20 7:19 PM, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-blk: Use kobj_to_dev() instead of container_of()
@ 2020-08-21 14:45 ` Jens Axboe
0 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2020-08-21 14:45 UTC (permalink / raw)
To: Tian Tao, mst, jasowang, pbonzini, stefanha, virtualization, linux-block
Cc: linuxarm
On 8/20/20 7:19 PM, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
Applied, thanks.
--
Jens Axboe
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [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.