All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: change iommu_map_sgtable to return signed values
@ 2023-10-11  8:01 Dan Carpenter
  2023-10-12  2:06 ` Baolu Lu
  2023-10-16  7:39 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-10-11  8:01 UTC (permalink / raw
  To: Joerg Roedel; +Cc: Will Deacon, Robin Murphy, iommu, kernel-janitors

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>
---
 include/linux/iommu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 0c4d8ae985ac..b5b254e205c6 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -1118,7 +1118,7 @@ static inline void iommu_free_global_pasid(ioasid_t pasid) {}
  * Creates a mapping at @iova for the buffer described by a scatterlist
  * stored in the given sg_table object in the provided IOMMU domain.
  */
-static inline size_t iommu_map_sgtable(struct iommu_domain *domain,
+static inline ssize_t iommu_map_sgtable(struct iommu_domain *domain,
 			unsigned long iova, struct sg_table *sgt, int prot)
 {
 	return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: change iommu_map_sgtable to return signed values
  2023-10-11  8:01 [PATCH] iommu: change iommu_map_sgtable to return signed values Dan Carpenter
@ 2023-10-12  2:06 ` Baolu Lu
  2023-10-16  7:39 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Baolu Lu @ 2023-10-12  2:06 UTC (permalink / raw
  To: Dan Carpenter, Joerg Roedel
  Cc: baolu.lu, Will Deacon, Robin Murphy, iommu, kernel-janitors

On 10/11/23 4:01 PM, Dan Carpenter wrote:
> 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> --- include/linux/iommu.h | 2 +- 1 file 
> changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: change iommu_map_sgtable to return signed values
  2023-10-11  8:01 [PATCH] iommu: change iommu_map_sgtable to return signed values Dan Carpenter
  2023-10-12  2:06 ` Baolu Lu
@ 2023-10-16  7:39 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2023-10-16  7:39 UTC (permalink / raw
  To: Dan Carpenter; +Cc: Will Deacon, Robin Murphy, iommu, kernel-janitors

On Wed, Oct 11, 2023 at 11:01:21AM +0300, Dan Carpenter wrote:
>  include/linux/iommu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-16  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11  8:01 [PATCH] iommu: change iommu_map_sgtable to return signed values Dan Carpenter
2023-10-12  2:06 ` Baolu Lu
2023-10-16  7:39 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.