linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfio: platform: No need to check res again
@ 2023-01-07  3:47 Angus Chen
  2023-01-16 20:37 ` Eric Auger
  2023-01-23 19:36 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Angus Chen @ 2023-01-07  3:47 UTC (permalink / raw)
  To: eric.auger, alex.williamson, cohuck; +Cc: kvm, linux-kernel, Angus Chen

In function vfio_platform_regions_init(),we did check res implied
by using while loop,
so no need to check whether res be null or not again.

No functional change intended.

Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
---
 drivers/vfio/platform/vfio_platform_common.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index 1a0a238ffa35..a9ad3f4d2613 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -150,9 +150,6 @@ static int vfio_platform_regions_init(struct vfio_platform_device *vdev)
 		struct resource *res =
 			vdev->get_resource(vdev, i);
 
-		if (!res)
-			goto err;
-
 		vdev->regions[i].addr = res->start;
 		vdev->regions[i].size = resource_size(res);
 		vdev->regions[i].flags = 0;
-- 
2.25.1


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

* Re: [PATCH] vfio: platform: No need to check res again
  2023-01-07  3:47 [PATCH] vfio: platform: No need to check res again Angus Chen
@ 2023-01-16 20:37 ` Eric Auger
  2023-01-23 19:36 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Auger @ 2023-01-16 20:37 UTC (permalink / raw)
  To: Angus Chen, alex.williamson, cohuck; +Cc: kvm, linux-kernel

Hi,
On 1/7/23 04:47, Angus Chen wrote:
> In function vfio_platform_regions_init(),we did check res implied
> by using while loop,
> so no need to check whether res be null or not again.
>
> No functional change intended.
>
> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  drivers/vfio/platform/vfio_platform_common.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
> index 1a0a238ffa35..a9ad3f4d2613 100644
> --- a/drivers/vfio/platform/vfio_platform_common.c
> +++ b/drivers/vfio/platform/vfio_platform_common.c
> @@ -150,9 +150,6 @@ static int vfio_platform_regions_init(struct vfio_platform_device *vdev)
>  		struct resource *res =
>  			vdev->get_resource(vdev, i);
>  
> -		if (!res)
> -			goto err;
> -
>  		vdev->regions[i].addr = res->start;
>  		vdev->regions[i].size = resource_size(res);
>  		vdev->regions[i].flags = 0;


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

* Re: [PATCH] vfio: platform: No need to check res again
  2023-01-07  3:47 [PATCH] vfio: platform: No need to check res again Angus Chen
  2023-01-16 20:37 ` Eric Auger
@ 2023-01-23 19:36 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2023-01-23 19:36 UTC (permalink / raw)
  To: Angus Chen; +Cc: eric.auger, cohuck, kvm, linux-kernel

On Sat,  7 Jan 2023 11:47:20 +0800
Angus Chen <angus.chen@jaguarmicro.com> wrote:

> In function vfio_platform_regions_init(),we did check res implied
> by using while loop,
> so no need to check whether res be null or not again.
> 
> No functional change intended.
> 
> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
> ---
>  drivers/vfio/platform/vfio_platform_common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
> index 1a0a238ffa35..a9ad3f4d2613 100644
> --- a/drivers/vfio/platform/vfio_platform_common.c
> +++ b/drivers/vfio/platform/vfio_platform_common.c
> @@ -150,9 +150,6 @@ static int vfio_platform_regions_init(struct vfio_platform_device *vdev)
>  		struct resource *res =
>  			vdev->get_resource(vdev, i);
>  
> -		if (!res)
> -			goto err;
> -
>  		vdev->regions[i].addr = res->start;
>  		vdev->regions[i].size = resource_size(res);
>  		vdev->regions[i].flags = 0;

Applied to vfio next branch for v6.3.  Thanks,

Alex


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

end of thread, other threads:[~2023-01-23 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07  3:47 [PATCH] vfio: platform: No need to check res again Angus Chen
2023-01-16 20:37 ` Eric Auger
2023-01-23 19:36 ` Alex Williamson

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).