Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm: Update the MMU helper function APIs

Instead of using a bare unsigned type for the length value for map/unmap
functions pass in a size_t to more correctly match up with the underlying
APIs.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Jordan Crouse and committed by
Rob Clark
fb212ad6 ccac7ce3

+6 -6
+2 -2
drivers/gpu/drm/msm/msm_gpummu.c
··· 26 26 } 27 27 28 28 static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, 29 - struct sg_table *sgt, unsigned len, int prot) 29 + struct sg_table *sgt, size_t len, int prot) 30 30 { 31 31 struct msm_gpummu *gpummu = to_msm_gpummu(mmu); 32 32 unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; ··· 54 54 return 0; 55 55 } 56 56 57 - static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len) 57 + static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) 58 58 { 59 59 struct msm_gpummu *gpummu = to_msm_gpummu(mmu); 60 60 unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE;
+2 -2
drivers/gpu/drm/msm/msm_iommu.c
··· 31 31 } 32 32 33 33 static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, 34 - struct sg_table *sgt, unsigned len, int prot) 34 + struct sg_table *sgt, size_t len, int prot) 35 35 { 36 36 struct msm_iommu *iommu = to_msm_iommu(mmu); 37 37 size_t ret; ··· 42 42 return (ret == len) ? 0 : -EINVAL; 43 43 } 44 44 45 - static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len) 45 + static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) 46 46 { 47 47 struct msm_iommu *iommu = to_msm_iommu(mmu); 48 48
+2 -2
drivers/gpu/drm/msm/msm_mmu.h
··· 12 12 struct msm_mmu_funcs { 13 13 void (*detach)(struct msm_mmu *mmu); 14 14 int (*map)(struct msm_mmu *mmu, uint64_t iova, struct sg_table *sgt, 15 - unsigned len, int prot); 16 - int (*unmap)(struct msm_mmu *mmu, uint64_t iova, unsigned len); 15 + size_t len, int prot); 16 + int (*unmap)(struct msm_mmu *mmu, uint64_t iova, size_t len); 17 17 void (*destroy)(struct msm_mmu *mmu); 18 18 }; 19 19