iommu/vt-d: remove unneeded validity check on dev
Subsystems (2)
PATCH 1/1 iommu/vt-d: remove unneeded validity check on dev
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.
--- drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +1 -1
@@ -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 ;
Signature · 1 line
2.30.2
Any thoughts?
Quoted 22 lines · 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 <[email protected]>--- drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/intel/iommu.c +1
-1@@ -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 ;
Signature · 5 lines
Muhammad Usama Anjum _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Lu Baolu
maintainerQuoted 1 line · Muhammad Usama Anjum
Any thoughts?
It looks good to me. I will queue it for v5.19.
Best regards,
baolu
Quoted 19 lines · Muhammad Usama Anjum
Quoted 17 lines
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 <[email protected]>--- drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/intel/iommu.c +0
-0@@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, } }
Quoted 6 lines
drivers/iommu/intel/iommu.c static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, · line 2508
Quoted 5 lines
drivers/iommu/intel/iommu.c +1
-1-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
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu