All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain()
@ 2021-05-13  7:58 Zhen Lei
  2021-06-08  9:52 ` Will Deacon
  2021-06-09  7:44 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Zhen Lei @ 2021-05-13  7:58 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, iommu; +Cc: Sai Praneeth Prakhya

Function iommu_group_store_type() is the only caller of the static
function iommu_change_dev_def_domain() and has performed
"if (WARN_ON(!group))" detection before calling it. So the one here is
redundant.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/iommu/iommu.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 971068da67cb91d..8cdf6a1c4bfd773 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -3059,9 +3059,6 @@ static int iommu_change_dev_def_domain(struct iommu_group *group,
 	int ret, dev_def_dom;
 	struct device *dev;
 
-	if (!group)
-		return -EINVAL;
-
 	mutex_lock(&group->mutex);
 
 	if (group->default_domain != group->domain) {
-- 
2.26.0.106.g9fadedd


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

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

* Re: [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain()
  2021-05-13  7:58 [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain() Zhen Lei
@ 2021-06-08  9:52 ` Will Deacon
  2021-06-09  7:44 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-06-08  9:52 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Sai Praneeth Prakhya, iommu

On Thu, May 13, 2021 at 03:58:15PM +0800, Zhen Lei wrote:
> Function iommu_group_store_type() is the only caller of the static
> function iommu_change_dev_def_domain() and has performed
> "if (WARN_ON(!group))" detection before calling it. So the one here is
> redundant.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/iommu/iommu.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 971068da67cb91d..8cdf6a1c4bfd773 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -3059,9 +3059,6 @@ static int iommu_change_dev_def_domain(struct iommu_group *group,
>  	int ret, dev_def_dom;
>  	struct device *dev;
>  
> -	if (!group)
> -		return -EINVAL;
> -
>  	mutex_lock(&group->mutex);
>  
>  	if (group->default_domain != group->domain) {

Acked-by: Will Deacon <will@kernel.org>

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

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

* Re: [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain()
  2021-05-13  7:58 [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain() Zhen Lei
  2021-06-08  9:52 ` Will Deacon
@ 2021-06-09  7:44 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2021-06-09  7:44 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Sai Praneeth Prakhya, iommu, Will Deacon

On Thu, May 13, 2021 at 03:58:15PM +0800, Zhen Lei wrote:
> Function iommu_group_store_type() is the only caller of the static
> function iommu_change_dev_def_domain() and has performed
> "if (WARN_ON(!group))" detection before calling it. So the one here is
> redundant.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/iommu/iommu.c | 3 ---
>  1 file changed, 3 deletions(-)

Applied, thanks.

> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 971068da67cb91d..8cdf6a1c4bfd773 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -3059,9 +3059,6 @@ static int iommu_change_dev_def_domain(struct iommu_group *group,
>  	int ret, dev_def_dom;
>  	struct device *dev;
>  
> -	if (!group)
> -		return -EINVAL;
> -
>  	mutex_lock(&group->mutex);
>  
>  	if (group->default_domain != group->domain) {
> -- 
> 2.26.0.106.g9fadedd
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2021-06-09  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13  7:58 [PATCH 1/1] iommu: Delete a duplicate check in iommu_change_dev_def_domain() Zhen Lei
2021-06-08  9:52 ` Will Deacon
2021-06-09  7:44 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.