Commit 3efcbe3e authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: staging: imgu: Address compiler / checker warnings in MMU code

Address C compiler, sparse and smatch warnings and little style issues in
the IMGU MMU code.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: default avatarRajmohan Mani <rajmohan.mani@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 0ace8734
...@@ -275,7 +275,17 @@ static size_t imgu_mmu_pgsize(unsigned long pgsize_bitmap, ...@@ -275,7 +275,17 @@ static size_t imgu_mmu_pgsize(unsigned long pgsize_bitmap,
return pgsize; return pgsize;
} }
/* drivers/iommu/iommu.c/iommu_map() */ /**
* imgu_mmu_map - map a buffer to a physical address
*
* @info: MMU mappable range
* @iova: the virtual address
* @paddr: the physical address
* @size: length of the mappable area
*
* The function has been adapted from iommu_map() in
* drivers/iommu/iommu.c .
*/
int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova, int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova,
phys_addr_t paddr, size_t size) phys_addr_t paddr, size_t size)
{ {
...@@ -321,7 +331,17 @@ int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova, ...@@ -321,7 +331,17 @@ int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova,
return ret; return ret;
} }
/* drivers/iommu/iommu.c/default_iommu_map_sg() */ /**
* imgu_mmu_map_sg - Map a scatterlist
*
* @info: MMU mappable range
* @iova: the virtual address
* @sg: the scatterlist to map
* @nents: number of entries in the scatterlist
*
* The function has been adapted from default_iommu_map_sg() in
* drivers/iommu/iommu.c .
*/
size_t imgu_mmu_map_sg(struct imgu_mmu_info *info, unsigned long iova, size_t imgu_mmu_map_sg(struct imgu_mmu_info *info, unsigned long iova,
struct scatterlist *sg, unsigned int nents) struct scatterlist *sg, unsigned int nents)
{ {
...@@ -394,7 +414,16 @@ static size_t __imgu_mmu_unmap(struct imgu_mmu *mmu, ...@@ -394,7 +414,16 @@ static size_t __imgu_mmu_unmap(struct imgu_mmu *mmu,
return unmap; return unmap;
} }
/* drivers/iommu/iommu.c/iommu_unmap() */ /**
* imgu_mmu_unmap - Unmap a buffer
*
* @info: MMU mappable range
* @iova: the virtual address
* @size: the length of the buffer
*
* The function has been adapted from iommu_unmap() in
* drivers/iommu/iommu.c .
*/
size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova, size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova,
size_t size) size_t size)
{ {
...@@ -444,6 +473,7 @@ size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova, ...@@ -444,6 +473,7 @@ size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova,
/** /**
* imgu_mmu_init() - initialize IPU3 MMU block * imgu_mmu_init() - initialize IPU3 MMU block
*
* @parent: struct device parent * @parent: struct device parent
* @base: IOMEM base of hardware registers. * @base: IOMEM base of hardware registers.
* *
...@@ -523,7 +553,8 @@ struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base) ...@@ -523,7 +553,8 @@ struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base)
/** /**
* imgu_mmu_exit() - clean up IPU3 MMU block * imgu_mmu_exit() - clean up IPU3 MMU block
* @info: IPU3 MMU private data *
* @info: MMU mappable range
*/ */
void imgu_mmu_exit(struct imgu_mmu_info *info) void imgu_mmu_exit(struct imgu_mmu_info *info)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment