Skip to content

Commit 058b4d9

Browse files
Dan Carpenterjoergroedel
authored andcommitted
iommu: change iommu_map_sgtable to return signed values
The iommu_map_sgtable() function returns ssize_t and negative error codes but it's declared as size_t instead. I think that static checkers would have complained if this caused a bug, but even though it doesn't cause a bug, it's definitely worth fixing. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/06672b96-23fd-424c-8880-1626e7bf119c@moroto.mountain Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent a8ca9fc commit 058b4d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/iommu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ static inline void iommu_free_global_pasid(ioasid_t pasid) {}
11161116
* Creates a mapping at @iova for the buffer described by a scatterlist
11171117
* stored in the given sg_table object in the provided IOMMU domain.
11181118
*/
1119-
static inline size_t iommu_map_sgtable(struct iommu_domain *domain,
1119+
static inline ssize_t iommu_map_sgtable(struct iommu_domain *domain,
11201120
unsigned long iova, struct sg_table *sgt, int prot)
11211121
{
11221122
return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot,

0 commit comments

Comments
 (0)