On Tue, 23 Jun 2026 at 01:58, Alejandro Jimenez <[email protected]> wrote: > > fetch_pte() returns a status code 0 on success, and (small) negative values > on failure. The PTE value itself is returned via an output parameter. > amdvi_get_top_pt_level_and_perms() follows the same return convention. > > Both functions currently return uint64_t, which means any negative error > values are returned as unsigned and then converted back to int by the > callers. This does not cause any issues in the current implementation, but > Coverity flags the type mismatch and potential overflow. > > Make both helpers return int, so the type matches what the return variable > is (0 on success, small negative value on failure), and also the type used > by all callers to store their return values. > > No functional changes are intended. > > Fixes: a1c97c395729 ("amd_iommu: Sync shadow page tables on page > invalidation") > Fixes: 786550e2d38a ("amd_iommu: Follow root pointer before page walk and use > 1-based levels") > Reported-by: Peter Maydell <[email protected]> > Suggested-by: Peter Maydell <[email protected]> > Signed-off-by: Alejandro Jimenez <[email protected]>
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
