[PATCH] vfio/spapr_tce: Remove the unused parameters container

Deming Wang posted 1 patch 3 years, 9 months ago
drivers/vfio/vfio_iommu_spapr_tce.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
[PATCH] vfio/spapr_tce: Remove the unused parameters container
Posted by Deming Wang 3 years, 9 months ago
The parameter of container has been unused for tce_iommu_unuse_page.
So, we should delete it.

Signed-off-by: Deming Wang <wangdeming@inspur.com>
---
 drivers/vfio/vfio_iommu_spapr_tce.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
index 708a95e61831..ea3d17a94e94 100644
--- a/drivers/vfio/vfio_iommu_spapr_tce.c
+++ b/drivers/vfio/vfio_iommu_spapr_tce.c
@@ -378,8 +378,7 @@ static void tce_iommu_release(void *iommu_data)
 	kfree(container);
 }
 
-static void tce_iommu_unuse_page(struct tce_container *container,
-		unsigned long hpa)
+static void tce_iommu_unuse_page(unsigned long hpa)
 {
 	struct page *page;
 
@@ -474,7 +473,7 @@ static int tce_iommu_clear(struct tce_container *container,
 			continue;
 		}
 
-		tce_iommu_unuse_page(container, oldhpa);
+		tce_iommu_unuse_page(oldhpa);
 	}
 
 	iommu_tce_kill(tbl, firstentry, pages);
@@ -524,7 +523,7 @@ static long tce_iommu_build(struct tce_container *container,
 		ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i,
 				&hpa, &dirtmp);
 		if (ret) {
-			tce_iommu_unuse_page(container, hpa);
+			tce_iommu_unuse_page(hpa);
 			pr_err("iommu_tce: %s failed ioba=%lx, tce=%lx, ret=%ld\n",
 					__func__, entry << tbl->it_page_shift,
 					tce, ret);
@@ -532,7 +531,7 @@ static long tce_iommu_build(struct tce_container *container,
 		}
 
 		if (dirtmp != DMA_NONE)
-			tce_iommu_unuse_page(container, hpa);
+			tce_iommu_unuse_page(hpa);
 
 		tce += IOMMU_PAGE_SIZE(tbl);
 	}
-- 
2.27.0
Re: [PATCH] vfio/spapr_tce: Remove the unused parameters container
Posted by Alex Williamson 3 years, 9 months ago
On Sat, 2 Jul 2022 02:46:13 -0400
Deming Wang <wangdeming@inspur.com> wrote:

> The parameter of container has been unused for tce_iommu_unuse_page.
> So, we should delete it.
> 
> Signed-off-by: Deming Wang <wangdeming@inspur.com>
> ---
>  drivers/vfio/vfio_iommu_spapr_tce.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Applied to vfio next branch for v5.20.  Thanks,

Alex

> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
> index 708a95e61831..ea3d17a94e94 100644
> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
> @@ -378,8 +378,7 @@ static void tce_iommu_release(void *iommu_data)
>  	kfree(container);
>  }
>  
> -static void tce_iommu_unuse_page(struct tce_container *container,
> -		unsigned long hpa)
> +static void tce_iommu_unuse_page(unsigned long hpa)
>  {
>  	struct page *page;
>  
> @@ -474,7 +473,7 @@ static int tce_iommu_clear(struct tce_container *container,
>  			continue;
>  		}
>  
> -		tce_iommu_unuse_page(container, oldhpa);
> +		tce_iommu_unuse_page(oldhpa);
>  	}
>  
>  	iommu_tce_kill(tbl, firstentry, pages);
> @@ -524,7 +523,7 @@ static long tce_iommu_build(struct tce_container *container,
>  		ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i,
>  				&hpa, &dirtmp);
>  		if (ret) {
> -			tce_iommu_unuse_page(container, hpa);
> +			tce_iommu_unuse_page(hpa);
>  			pr_err("iommu_tce: %s failed ioba=%lx, tce=%lx, ret=%ld\n",
>  					__func__, entry << tbl->it_page_shift,
>  					tce, ret);
> @@ -532,7 +531,7 @@ static long tce_iommu_build(struct tce_container *container,
>  		}
>  
>  		if (dirtmp != DMA_NONE)
> -			tce_iommu_unuse_page(container, hpa);
> +			tce_iommu_unuse_page(hpa);
>  
>  		tce += IOMMU_PAGE_SIZE(tbl);
>  	}
Re: [PATCH] vfio/spapr_tce: Remove the unused parameters container
Posted by Alex Williamson 3 years, 9 months ago
On Sat, 2 Jul 2022 02:46:13 -0400
Deming Wang <wangdeming@inspur.com> wrote:

> The parameter of container has been unused for tce_iommu_unuse_page.
> So, we should delete it.
> 
> Signed-off-by: Deming Wang <wangdeming@inspur.com>
> ---
>  drivers/vfio/vfio_iommu_spapr_tce.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

I'll give Alexey a chance to ack this, but agree that it seems this arg
has never had any purpose.  Perhaps a debugging remnant.  Thanks,

Alex

> 
> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
> index 708a95e61831..ea3d17a94e94 100644
> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
> @@ -378,8 +378,7 @@ static void tce_iommu_release(void *iommu_data)
>  	kfree(container);
>  }
>  
> -static void tce_iommu_unuse_page(struct tce_container *container,
> -		unsigned long hpa)
> +static void tce_iommu_unuse_page(unsigned long hpa)
>  {
>  	struct page *page;
>  
> @@ -474,7 +473,7 @@ static int tce_iommu_clear(struct tce_container *container,
>  			continue;
>  		}
>  
> -		tce_iommu_unuse_page(container, oldhpa);
> +		tce_iommu_unuse_page(oldhpa);
>  	}
>  
>  	iommu_tce_kill(tbl, firstentry, pages);
> @@ -524,7 +523,7 @@ static long tce_iommu_build(struct tce_container *container,
>  		ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i,
>  				&hpa, &dirtmp);
>  		if (ret) {
> -			tce_iommu_unuse_page(container, hpa);
> +			tce_iommu_unuse_page(hpa);
>  			pr_err("iommu_tce: %s failed ioba=%lx, tce=%lx, ret=%ld\n",
>  					__func__, entry << tbl->it_page_shift,
>  					tce, ret);
> @@ -532,7 +531,7 @@ static long tce_iommu_build(struct tce_container *container,
>  		}
>  
>  		if (dirtmp != DMA_NONE)
> -			tce_iommu_unuse_page(container, hpa);
> +			tce_iommu_unuse_page(hpa);
>  
>  		tce += IOMMU_PAGE_SIZE(tbl);
>  	}
Re: [PATCH] vfio/spapr_tce: Remove the unused parameters container
Posted by Alexey Kardashevskiy 3 years, 9 months ago

On 07/07/2022 05:14, Alex Williamson wrote:
> On Sat, 2 Jul 2022 02:46:13 -0400
> Deming Wang <wangdeming@inspur.com> wrote:
> 
>> The parameter of container has been unused for tce_iommu_unuse_page.
>> So, we should delete it.
>>
>> Signed-off-by: Deming Wang <wangdeming@inspur.com>
>> ---
>>   drivers/vfio/vfio_iommu_spapr_tce.c | 9 ++++-----
>>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> I'll give Alexey a chance to ack this, but agree that it seems this arg
> has never had any purpose.  Perhaps a debugging remnant.  Thanks,


yup, that was debugging...

Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>



> 
> Alex
> 
>>
>> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
>> index 708a95e61831..ea3d17a94e94 100644
>> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
>> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
>> @@ -378,8 +378,7 @@ static void tce_iommu_release(void *iommu_data)
>>   	kfree(container);
>>   }
>>   
>> -static void tce_iommu_unuse_page(struct tce_container *container,
>> -		unsigned long hpa)
>> +static void tce_iommu_unuse_page(unsigned long hpa)
>>   {
>>   	struct page *page;
>>   
>> @@ -474,7 +473,7 @@ static int tce_iommu_clear(struct tce_container *container,
>>   			continue;
>>   		}
>>   
>> -		tce_iommu_unuse_page(container, oldhpa);
>> +		tce_iommu_unuse_page(oldhpa);
>>   	}
>>   
>>   	iommu_tce_kill(tbl, firstentry, pages);
>> @@ -524,7 +523,7 @@ static long tce_iommu_build(struct tce_container *container,
>>   		ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i,
>>   				&hpa, &dirtmp);
>>   		if (ret) {
>> -			tce_iommu_unuse_page(container, hpa);
>> +			tce_iommu_unuse_page(hpa);
>>   			pr_err("iommu_tce: %s failed ioba=%lx, tce=%lx, ret=%ld\n",
>>   					__func__, entry << tbl->it_page_shift,
>>   					tce, ret);
>> @@ -532,7 +531,7 @@ static long tce_iommu_build(struct tce_container *container,
>>   		}
>>   
>>   		if (dirtmp != DMA_NONE)
>> -			tce_iommu_unuse_page(container, hpa);
>> +			tce_iommu_unuse_page(hpa);
>>   
>>   		tce += IOMMU_PAGE_SIZE(tbl);
>>   	}
> 

-- 
Alexey