iommu: Delete a duplicate check in iommu_change_dev_def_domain()
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 13 May 2021 07:58:15 +0000 (15:58 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 9 Jun 2021 07:43:17 +0000 (09:43 +0200)
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>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210513075815.6382-1-thunder.leizhen@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c

index 808ab70d5df50f7839dafc489cfcc4519d05ec06..5419c4b9f27ada00f31f86b0a6eb3adc19f56753 100644 (file)
@@ -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) {