vfio: platform: use platform_get_resource()
Subsystems (3)
PATCH 1/1 vfio: platform: use platform_get_resource()
Use platform_get_resource() to fetch the memory resource instead of open-coded variant.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/vfio/platform/vfio_platform.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
drivers/vfio/platform/vfio_platform.c +5 -11
@@ -25,19 +25,13 @@ static struct resource *get_platform_resource(struct vfio_platform_device *vdev, int num) {struct platform_device *dev = (struct platform_device *) vdev->opaque; -int i; +struct resource *res; -for (i =0 ; i < dev->num_resources; i++) { -struct resource *r = &dev->resource[i]; + res =platform_get_resource (dev,IORESOURCE_MEM , num); +if (res) +return res; -if (resource_type (r) & (IORESOURCE_MEM |IORESOURCE_IO )) { -if (!num) -return r; - - num--; - } - } -return NULL ; +return platform_get_resource (dev,IORESOURCE_IO , num); }static int get_platform_irq (struct vfio_platform_device *vdev,int i)
Signature · 1 line
2.27.0
Quoted 8 lines · On Tue, 4 Aug 2020 16:56:22 +0300 Andy Shevchenko…
Use
platform_get_resource()to fetch the memory resource instead of open-coded variant.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/vfio/platform/vfio_platform.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
Reviewed-by Cornelia Huck <[email protected]>
Quoted 7 lines · Cornelia Huck
Quoted 2 lines · On Tue, 4 Aug 2020 16:56:22 +0300 Andy Shevchenko…
Use
platform_get_resource()to fetch the memory resource instead of open-coded variant.Reviewed-by Cornelia Huck <[email protected]>
Thanks! I have better approach now, please, postpone this one. I'll send it after v5.9-rc1.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 7 lines · Cornelia Huck
Quoted 2 lines · On Tue, 4 Aug 2020 16:56:22 +0300 Andy Shevchenko…
Use
platform_get_resource()to fetch the memory resource instead of open-coded variant.Reviewed-by Cornelia Huck <[email protected]>Thanks! I have better approach now, please, postpone this one. I'll send it after v5.9-rc1.
FYI: It's part of the series [1].
[1]: https://lore.kernel.org/lkml/[email protected]/T/
Signature · 2 lines
With Best Regards, Andy Shevchenko