iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Remove duplicate check of devid
@ 2021-04-09  1:31 Shaokun Zhang
  2021-04-09  3:02 ` Shaokun Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Shaokun Zhang @ 2021-04-09  1:31 UTC (permalink / raw)
  To: iommu; +Cc: Shaokun Zhang, Will Deacon

'devid' has been checked in function check_device, no need to double
check and clean up this.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 drivers/iommu/amd/iommu.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index b4fa94a97446..4130df7c30c6 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -1676,10 +1676,6 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
 	if (!check_device(dev))
 		return ERR_PTR(-ENODEV);
 
-	devid = get_device_id(dev);
-	if (devid < 0)
-		return ERR_PTR(devid);
-
 	iommu = amd_iommu_rlookup_table[devid];
 
 	if (dev_iommu_priv_get(dev))
@@ -1967,10 +1963,6 @@ static void amd_iommu_detach_device(struct iommu_domain *dom,
 	if (!check_device(dev))
 		return;
 
-	devid = get_device_id(dev);
-	if (devid < 0)
-		return;
-
 	if (dev_data->domain != NULL)
 		detach_device(dev);
 
-- 
2.7.4

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/amd: Remove duplicate check of devid
  2021-04-09  1:31 [PATCH] iommu/amd: Remove duplicate check of devid Shaokun Zhang
@ 2021-04-09  3:02 ` Shaokun Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Shaokun Zhang @ 2021-04-09  3:02 UTC (permalink / raw)
  To: iommu; +Cc: Will Deacon

Apologies for my mistake:

devid = get_device_id(dev) is need, only the check is unnecessary.

Thanks,
Shaokun

On 2021/4/9 9:31, Shaokun Zhang wrote:
> 'devid' has been checked in function check_device, no need to double
> check and clean up this.
> 
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
>  drivers/iommu/amd/iommu.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index b4fa94a97446..4130df7c30c6 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -1676,10 +1676,6 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
>  	if (!check_device(dev))
>  		return ERR_PTR(-ENODEV);
>  
> -	devid = get_device_id(dev);
> -	if (devid < 0)
> -		return ERR_PTR(devid);
> -
>  	iommu = amd_iommu_rlookup_table[devid];
>  
>  	if (dev_iommu_priv_get(dev))
> @@ -1967,10 +1963,6 @@ static void amd_iommu_detach_device(struct iommu_domain *dom,
>  	if (!check_device(dev))
>  		return;
>  
> -	devid = get_device_id(dev);
> -	if (devid < 0)
> -		return;
> -
>  	if (dev_data->domain != NULL)
>  		detach_device(dev);
>  
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2021-04-09  3:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  1:31 [PATCH] iommu/amd: Remove duplicate check of devid Shaokun Zhang
2021-04-09  3:02 ` Shaokun Zhang

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