All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/vt-d: remove unneeded validity check on dev
@ 2022-03-13 15:03 ` Muhammad Usama Anjum
  0 siblings, 0 replies; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-03-13 15:03 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon
  Cc: Muhammad Usama Anjum, kernel, iommu, linux-kernel

dev_iommu_priv_get() is being used at the top of this function which
dereferences dev. Dev cannot be NULL after this. Remove the validity
check on dev and simplify the code.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 drivers/iommu/intel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index df5c62ecf942b..f79edbbd651a4 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
 		}
 	}
 
-	if (dev && domain_context_mapping(domain, dev)) {
+	if (domain_context_mapping(domain, dev)) {
 		dev_err(dev, "Domain context map failed\n");
 		dmar_remove_one_dev_info(dev);
 		return NULL;
-- 
2.30.2


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

* [PATCH] iommu/vt-d: remove unneeded validity check on dev
@ 2022-03-13 15:03 ` Muhammad Usama Anjum
  0 siblings, 0 replies; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-03-13 15:03 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon
  Cc: iommu, kernel, linux-kernel, Muhammad Usama Anjum

dev_iommu_priv_get() is being used at the top of this function which
dereferences dev. Dev cannot be NULL after this. Remove the validity
check on dev and simplify the code.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 drivers/iommu/intel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index df5c62ecf942b..f79edbbd651a4 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
 		}
 	}
 
-	if (dev && domain_context_mapping(domain, dev)) {
+	if (domain_context_mapping(domain, dev)) {
 		dev_err(dev, "Domain context map failed\n");
 		dmar_remove_one_dev_info(dev);
 		return NULL;
-- 
2.30.2

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

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

* Re: [PATCH] iommu/vt-d: remove unneeded validity check on dev
  2022-03-13 15:03 ` Muhammad Usama Anjum
@ 2022-04-04  7:52   ` Muhammad Usama Anjum
  -1 siblings, 0 replies; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-04-04  7:52 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon
  Cc: usama.anjum, kernel, iommu, linux-kernel

Any thoughts?

On 3/13/22 8:03 PM, Muhammad Usama Anjum wrote:
> dev_iommu_priv_get() is being used at the top of this function which
> dereferences dev. Dev cannot be NULL after this. Remove the validity
> check on dev and simplify the code.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
>  drivers/iommu/intel/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index df5c62ecf942b..f79edbbd651a4 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
>  		}
>  	}
>  
> -	if (dev && domain_context_mapping(domain, dev)) {
> +	if (domain_context_mapping(domain, dev)) {
>  		dev_err(dev, "Domain context map failed\n");
>  		dmar_remove_one_dev_info(dev);
>  		return NULL;

-- 
Muhammad Usama Anjum

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

* Re: [PATCH] iommu/vt-d: remove unneeded validity check on dev
@ 2022-04-04  7:52   ` Muhammad Usama Anjum
  0 siblings, 0 replies; 6+ messages in thread
From: Muhammad Usama Anjum @ 2022-04-04  7:52 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon
  Cc: iommu, kernel, linux-kernel, usama.anjum

Any thoughts?

On 3/13/22 8:03 PM, Muhammad Usama Anjum wrote:
> dev_iommu_priv_get() is being used at the top of this function which
> dereferences dev. Dev cannot be NULL after this. Remove the validity
> check on dev and simplify the code.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
>  drivers/iommu/intel/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index df5c62ecf942b..f79edbbd651a4 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
>  		}
>  	}
>  
> -	if (dev && domain_context_mapping(domain, dev)) {
> +	if (domain_context_mapping(domain, dev)) {
>  		dev_err(dev, "Domain context map failed\n");
>  		dmar_remove_one_dev_info(dev);
>  		return NULL;

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

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

* Re: [PATCH] iommu/vt-d: remove unneeded validity check on dev
  2022-04-04  7:52   ` Muhammad Usama Anjum
@ 2022-04-05  1:38     ` Lu Baolu
  -1 siblings, 0 replies; 6+ messages in thread
From: Lu Baolu @ 2022-04-05  1:38 UTC (permalink / raw)
  To: Muhammad Usama Anjum, David Woodhouse, Joerg Roedel, Will Deacon
  Cc: iommu, kernel, linux-kernel

On 2022/4/4 15:52, Muhammad Usama Anjum wrote:
> Any thoughts?

It looks good to me. I will queue it for v5.19.

Best regards,
baolu

> 
> On 3/13/22 8:03 PM, Muhammad Usama Anjum wrote:
>> dev_iommu_priv_get() is being used at the top of this function which
>> dereferences dev. Dev cannot be NULL after this. Remove the validity
>> check on dev and simplify the code.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>>   drivers/iommu/intel/iommu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index df5c62ecf942b..f79edbbd651a4 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
>>   		}
>>   	}
>>   
>> -	if (dev && domain_context_mapping(domain, dev)) {
>> +	if (domain_context_mapping(domain, dev)) {
>>   		dev_err(dev, "Domain context map failed\n");
>>   		dmar_remove_one_dev_info(dev);
>>   		return NULL;
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/vt-d: remove unneeded validity check on dev
@ 2022-04-05  1:38     ` Lu Baolu
  0 siblings, 0 replies; 6+ messages in thread
From: Lu Baolu @ 2022-04-05  1:38 UTC (permalink / raw)
  To: Muhammad Usama Anjum, David Woodhouse, Joerg Roedel, Will Deacon
  Cc: baolu.lu, kernel, iommu, linux-kernel

On 2022/4/4 15:52, Muhammad Usama Anjum wrote:
> Any thoughts?

It looks good to me. I will queue it for v5.19.

Best regards,
baolu

> 
> On 3/13/22 8:03 PM, Muhammad Usama Anjum wrote:
>> dev_iommu_priv_get() is being used at the top of this function which
>> dereferences dev. Dev cannot be NULL after this. Remove the validity
>> check on dev and simplify the code.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>>   drivers/iommu/intel/iommu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index df5c62ecf942b..f79edbbd651a4 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
>>   		}
>>   	}
>>   
>> -	if (dev && domain_context_mapping(domain, dev)) {
>> +	if (domain_context_mapping(domain, dev)) {
>>   		dev_err(dev, "Domain context map failed\n");
>>   		dmar_remove_one_dev_info(dev);
>>   		return NULL;
> 

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

end of thread, other threads:[~2022-04-05  2:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-13 15:03 [PATCH] iommu/vt-d: remove unneeded validity check on dev Muhammad Usama Anjum
2022-03-13 15:03 ` Muhammad Usama Anjum
2022-04-04  7:52 ` Muhammad Usama Anjum
2022-04-04  7:52   ` Muhammad Usama Anjum
2022-04-05  1:38   ` Lu Baolu
2022-04-05  1:38     ` Lu Baolu

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.