mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 07/10] fuse: use clamp() rather than nested min/max
@ 2008-03-14  5:21 Harvey Harrison
  0 siblings, 0 replies; only message in thread
From: Harvey Harrison @ 2008-03-14  5:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

clamp() exists for this use.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 fs/fuse/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 676b0bc..8c6d51d 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -613,7 +613,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(&current->mm->mmap_sem);
 	npages = get_user_pages(current, current->mm, user_addr, npages, write,
 				0, req->pages, NULL);
-- 
1.5.4.4.653.g7cf1e



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-14  5:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  5:21 [PATCH 07/10] fuse: use clamp() rather than nested min/max Harvey Harrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®