summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2026-01-22 14:42:38 -0700
committerJoerg Roedel <joerg.roedel@amd.com>2026-01-28 15:13:01 +0100
commit5b0530bb16ec5af3cc96fc25891d6a860fd37a8c (patch)
treedb1a48bb003eb98bab09e0b65bc7e1eee90247bc /rust/kernel
parentc0a652a3d1970caa0023632ae3a4ea21991d2f1a (diff)
iommu/amd: Fix type of type parameter to amd_iommufd_hw_info()
When building with -Wincompatible-function-pointer-types-strict, a warning designed to catch kernel control flow integrity (kCFI) issues at build time, there is an instance around amd_iommufd_hw_info(): drivers/iommu/amd/iommu.c:3141:13: error: incompatible function pointer types initializing 'void *(*)(struct device *, u32 *, enum iommu_hw_info_type *)' (aka 'void *(*)(struct device *, unsigned int *, enum iommu_hw_info_type *)') with an expression of type 'void *(struct device *, u32 *, u32 *)' (aka 'void *(struct device *, unsigned int *, unsigned int *)') [-Werror,-Wincompatible-function-pointer-types-strict] 3141 | .hw_info = amd_iommufd_hw_info, | ^~~~~~~~~~~~~~~~~~~ While 'u32 *' and 'enum iommu_hw_info_type *' are ABI compatible, hence no regular warning from -Wincompatible-function-pointer-types, the mismatch will trigger a kCFI violation when amd_iommufd_hw_info() is called indirectly. Update the type parameter of amd_iommufd_hw_info() to be 'enum iommu_hw_info_type *' to match the prototype in 'struct iommu_ops', clearing up the warning and kCFI violation. Fixes: 7d8b06ecc45b ("iommu/amd: Add support for hw_info for iommu capability query") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions