提交 27f6b318 编写于 作者: P Pavel Begunkov 提交者: Jens Axboe

io_uring: fix min types mismatch in table alloc

fs/io_uring.c: In function 'io_alloc_page_table':
include/linux/minmax.h:20:28: warning: comparison of distinct pointer
	types lacks a cast

Cast everything to size_t using min_t.
Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
Fixes: 9123c8ff ("io_uring: add helpers for 2 level table alloc")
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/50f420a956bca070a43810d4a805293ed54f39d8.1623759527.git.asml.silence@gmail.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 dd9ae8a0
......@@ -7088,7 +7088,7 @@ static void **io_alloc_page_table(size_t size)
return NULL;
for (i = 0; i < nr_tables; i++) {
unsigned int this_size = min(size, PAGE_SIZE);
unsigned int this_size = min_t(size_t, size, PAGE_SIZE);
table[i] = kzalloc(this_size, GFP_KERNEL);
if (!table[i]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册