]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommufd/selftest: Drop parent domain from mock_iommu_domain_nested
authorNicolin Chen <nicolinc@nvidia.com>
Sat, 14 Jun 2025 06:35:20 +0000 (23:35 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 19 Jun 2025 18:43:29 +0000 (15:43 -0300)
There is no use of this parent domain. Delete the dead code.

Note that the s2_parent in struct mock_viommu will be a deadcode too. Yet,
keep it because it will be soon used by HW queue objects, i.e. no point in
adding it back and forth in such a short window. Besides, keeping it could
cover the majority of vIOMMU use cases where a driver-level structure will
be larger in size than the core structure.

Link: https://patch.msgid.link/r/0f155a7cd71034a498448fe4828fb4aaacdabf95.1749882255.git.nicolinc@nvidia.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/selftest.c

index 4d5dca8027b1b8d32891e7c0cb2c628b4e82ffda..f9cfb3a20860ef2107ba7ecb36999cb56a57bdc3 100644 (file)
@@ -138,7 +138,6 @@ to_mock_domain(struct iommu_domain *domain)
 struct mock_iommu_domain_nested {
        struct iommu_domain domain;
        struct mock_viommu *mock_viommu;
-       struct mock_iommu_domain *parent;
        u32 iotlb[MOCK_NESTED_DOMAIN_IOTLB_NUM];
 };
 
@@ -434,7 +433,6 @@ mock_domain_alloc_nested(struct device *dev, struct iommu_domain *parent,
        mock_nested = __mock_domain_alloc_nested(user_data);
        if (IS_ERR(mock_nested))
                return ERR_CAST(mock_nested);
-       mock_nested->parent = mock_parent;
        return &mock_nested->domain;
 }
 
@@ -692,7 +690,6 @@ mock_viommu_alloc_domain_nested(struct iommufd_viommu *viommu, u32 flags,
        if (IS_ERR(mock_nested))
                return ERR_CAST(mock_nested);
        mock_nested->mock_viommu = mock_viommu;
-       mock_nested->parent = mock_viommu->s2_parent;
        return &mock_nested->domain;
 }