mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
fuse: use clamp() rather than nested min/max
clamp() exists for this use. Signed-off-by: Harvey Harrison <[email protected]> Cc: Miklos Szeredi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3dfcf9c4bf
commit
bd7309677c
1 changed files with 1 additions and 1 deletions
|
|
@ -934,7 +934,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
|
|||
|
||||
nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
|
||||
npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||
npages = min(max(npages, 1), FUSE_MAX_PAGES_PER_REQ);
|
||||
npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ);
|
||||
down_read(¤t->mm->mmap_sem);
|
||||
npages = get_user_pages(current, current->mm, user_addr, npages, write,
|
||||
0, req->pages, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue