summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-12-12 13:40:48 +0100
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-23 16:18:19 +0200
commitb29ecab178b074be999afd5d6bf6e5b4c2bb782b (patch)
treecbedf27675932b3ddb8fb907bb085edfb846a825 /drivers/media
parentmedia: videobuf2-dma-sg: Prevent size from overflowing (diff)
downloadlinux-b29ecab178b074be999afd5d6bf6e5b4c2bb782b.tar.xz
linux-b29ecab178b074be999afd5d6bf6e5b4c2bb782b.zip
media: videobuf2-core.h: Document the alloc memop size argument as page aligned
The size argument of the alloc memop, which allocates buffer memory, is page aligned. Document it as such in the only caller as well as ops documentation. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/videobuf2/videobuf2-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index cfccee87909a..4489744fbbd9 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -205,6 +205,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
* NOTE: mmapped areas should be page aligned
*/
for (plane = 0; plane < vb->num_planes; ++plane) {
+ /* Memops alloc requires size to be page aligned. */
unsigned long size = PAGE_ALIGN(vb->planes[plane].length);
/* Did it wrap around? */