hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/release-management/issues/ID5W1P --------------------------------------- Using min_t to explicitly convert the input to match the output. Signed-off-by: Huang Xiaojia <huangxiaojia2@huawei.com> --- fs/mfs/data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/mfs/data.c b/fs/mfs/data.c index 37f6f9425206..32d0b6947aa8 100644 --- a/fs/mfs/data.c +++ b/fs/mfs/data.c @@ -327,7 +327,7 @@ static ssize_t mfs_read_iter(struct kiocb *iocb, struct iov_iter *to) ctx.object = file_inode(file)->i_private; ctx.off = iocb->ki_pos; ctx.op = MFS_OP_READ; - ctx.len = min(isize - ctx.off, iov_iter_count(to)); + ctx.len = min_t(size_t, isize - ctx.off, iov_iter_count(to)); ctx.sync = false; ctx.checker = range_check_mem; if (need_sync_event(file_inode(file)->i_sb)) { @@ -396,7 +396,7 @@ static vm_fault_t mfs_filemap_fault(struct vm_fault *vmf) ctx.file = cfile; ctx.object = file_inode(file)->i_private; ctx.off = vmf->pgoff << PAGE_SHIFT; - ctx.len = min(isize - ctx.off, PAGE_SIZE); + ctx.len = min_t(size_t, isize - ctx.off, PAGE_SIZE); ctx.op = MFS_OP_FAULT; ctx.sync = false; ctx.checker = range_check_mem; @@ -452,7 +452,7 @@ static vm_fault_t mfs_filemap_map_pages(struct vm_fault *vmf, ctx.file = cfile; ctx.object = file_inode(file)->i_private; ctx.off = start_pgoff << PAGE_SHIFT; - ctx.len = min(isize - ctx.off, (end_pgoff - start_pgoff) << PAGE_SHIFT); + ctx.len = min_t(size_t, isize - ctx.off, (end_pgoff - start_pgoff) << PAGE_SHIFT); ctx.op = MFS_OP_FAROUND; ctx.sync = false; ctx.checker = range_check_mem; -- 2.25.1