提交 1bede752 编写于 作者: M Mauro Carvalho Chehab

[media] videobuf-dma-sg: Use min_t(size_t, PAGE_SIZE ..)

As pointed by Laurent:

I think min_t(size_t, PAGE_SIZE, size) is the preferred way.

Thanks-to: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 22c00854
...@@ -116,8 +116,8 @@ static struct scatterlist *videobuf_pages_to_sg(struct page **pages, ...@@ -116,8 +116,8 @@ static struct scatterlist *videobuf_pages_to_sg(struct page **pages,
goto nopage; goto nopage;
if (PageHighMem(pages[i])) if (PageHighMem(pages[i]))
goto highmem; goto highmem;
sg_set_page(&sglist[i], pages[i], min((unsigned)PAGE_SIZE, size), 0); sg_set_page(&sglist[i], pages[i], min_t(size_t, PAGE_SIZE, size), 0);
size -= min((unsigned)PAGE_SIZE, size); size -= min_t(size_t, PAGE_SIZE, size);
} }
return sglist; return sglist;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册