]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu: Use enum iommu_hw_info_type for type in hw_info op
authorNicolin Chen <nicolinc@nvidia.com>
Thu, 10 Jul 2025 05:58:56 +0000 (22:58 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 10 Jul 2025 15:38:50 +0000 (12:38 -0300)
Replace u32 to make it clear. No functional changes.

Also simplify the kdoc since the type itself is clear enough.

Link: https://patch.msgid.link/r/651c50dee8ab900f691202ef0204cd5a43fdd6a2.1752126748.git.nicolinc@nvidia.com
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
drivers/iommu/intel/iommu.c
drivers/iommu/iommufd/selftest.c
include/linux/iommu.h

index 9f59c95a254cc84129bf67c980f97656b946323a..69bbe39e28de854a2c71cab08e7d11cd1546db09 100644 (file)
@@ -7,7 +7,8 @@
 
 #include "arm-smmu-v3.h"
 
-void *arm_smmu_hw_info(struct device *dev, u32 *length, u32 *type)
+void *arm_smmu_hw_info(struct device *dev, u32 *length,
+                      enum iommu_hw_info_type *type)
 {
        struct arm_smmu_master *master = dev_iommu_priv_get(dev);
        struct iommu_hw_info_arm_smmuv3 *info;
index bb39af84e6b0a3f1a0273eea2445e07a4bdebd1f..04463a4aaa2628b2027a050438547b2ed4d4d4c7 100644 (file)
@@ -1033,7 +1033,8 @@ struct arm_vsmmu {
 };
 
 #if IS_ENABLED(CONFIG_ARM_SMMU_V3_IOMMUFD)
-void *arm_smmu_hw_info(struct device *dev, u32 *length, u32 *type);
+void *arm_smmu_hw_info(struct device *dev, u32 *length,
+                      enum iommu_hw_info_type *type);
 size_t arm_smmu_get_viommu_size(struct device *dev,
                                enum iommu_viommu_type viommu_type);
 int arm_vsmmu_init(struct iommufd_viommu *viommu,
index 7aa3932251b2fd6d632f5040cac4ba21d474a3f5..850f1a6f548cc9a6a57b96d1522ea9b647a4c900 100644 (file)
@@ -4091,7 +4091,8 @@ out_remove_dev_pasid:
        return ret;
 }
 
-static void *intel_iommu_hw_info(struct device *dev, u32 *length, u32 *type)
+static void *intel_iommu_hw_info(struct device *dev, u32 *length,
+                                enum iommu_hw_info_type *type)
 {
        struct device_domain_info *info = dev_iommu_priv_get(dev);
        struct intel_iommu *iommu = info->iommu;
index 74ca955a766e75be009a8533a39d78e8910fcb3f..7a9abe3f47d5bc1bb5c0b7d35c24e0b1c36f0347 100644 (file)
@@ -287,7 +287,8 @@ static struct iommu_domain mock_blocking_domain = {
        .ops = &mock_blocking_ops,
 };
 
-static void *mock_domain_hw_info(struct device *dev, u32 *length, u32 *type)
+static void *mock_domain_hw_info(struct device *dev, u32 *length,
+                                enum iommu_hw_info_type *type)
 {
        struct iommu_test_hw_info *info;
 
index 04548b18df28fe9fa9374b333edc3035bfc810cd..b87c2841e6bc150cfa8dff18cf7bc68c3bbb3dc6 100644 (file)
@@ -563,8 +563,7 @@ iommu_copy_struct_from_full_user_array(void *kdst, size_t kdst_entry_size,
  * @capable: check capability
  * @hw_info: report iommu hardware information. The data buffer returned by this
  *           op is allocated in the iommu driver and freed by the caller after
- *           use. The information type is one of enum iommu_hw_info_type defined
- *           in include/uapi/linux/iommufd.h.
+ *           use.
  * @domain_alloc: Do not use in new drivers
  * @domain_alloc_identity: allocate an IDENTITY domain. Drivers should prefer to
  *                         use identity_domain instead. This should only be used
@@ -623,7 +622,8 @@ iommu_copy_struct_from_full_user_array(void *kdst, size_t kdst_entry_size,
  */
 struct iommu_ops {
        bool (*capable)(struct device *dev, enum iommu_cap);
-       void *(*hw_info)(struct device *dev, u32 *length, u32 *type);
+       void *(*hw_info)(struct device *dev, u32 *length,
+                        enum iommu_hw_info_type *type);
 
        /* Domain allocation and freeing by the iommu driver */
 #if IS_ENABLED(CONFIG_FSL_PAMU)