* [PATCH V2] drivers/block: Use kobj_to_dev() API
@ 2020-06-20 1:53 Wang Qing
2020-06-22 9:56 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-06-20 1:53 UTC (permalink / raw)
To: Michael S. Tsirkin, Jason Wang, Paolo Bonzini, Stefan Hajnoczi,
Jens Axboe, virtualization, linux-block, linux-kernel
Cc: Wang Qing
Use kobj_to_dev() API instead of container_of().
Signed-off-by: Wang Qing <wangqing@vivo.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 9d21bf0..c808405
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -630,7 +630,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] 2+ messages in thread
* Re: [PATCH V2] drivers/block: Use kobj_to_dev() API
2020-06-20 1:53 [PATCH V2] drivers/block: Use kobj_to_dev() API Wang Qing
@ 2020-06-22 9:56 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2020-06-22 9:56 UTC (permalink / raw)
To: Wang Qing
Cc: Michael S. Tsirkin, Jason Wang, Paolo Bonzini, Jens Axboe,
virtualization, linux-block, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 313 bytes --]
On Sat, Jun 20, 2020 at 09:53:43AM +0800, Wang Qing wrote:
> Use kobj_to_dev() API instead of container_of().
>
> Signed-off-by: Wang Qing <wangqing@vivo.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] 2+ messages in thread
end of thread, other threads:[~2020-06-22 9:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-20 1:53 [PATCH V2] drivers/block: Use kobj_to_dev() API Wang Qing
2020-06-22 9:56 ` Stefan Hajnoczi
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).