From: Muhammad Usama Anjum Date: Tue, 10 May 2022 02:34:00 +0000 (+0800) Subject: iommu/vt-d: Remove unneeded validity check on dev X-Git-Tag: v5.19-rc1~90^2^6~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd901e9284c7893eebee6857ebe30b691ea91224;p=thirdparty%2Fkernel%2Flinux.git 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. Signed-off-by: Muhammad Usama Anjum Link: https://lore.kernel.org/r/20220313150337.593650-1-usama.anjum@collabora.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220510023407.2759143-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index efcecfa5952ae..b5caea9a7e789 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -2501,7 +2501,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;