From 3c149d20166d315e0ec9296689e62605e79343e7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 20 Feb 2013 13:15:58 +1100 Subject: [PATCH] fs-proc-vmcorec-put-if-tests-in-the-top-of-the-while-loop-to-reduce-duplication-fix-fix s/max_t/min_t/ Cc: Zhang Yanfei Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton --- fs/proc/vmcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 6e2bcf4c051f..b870f740ab5a 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -178,7 +178,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, return -EINVAL; while (buflen) { - tsz = max_t(size_t, buflen, PAGE_SIZE - (start & ~PAGE_MASK)); + tsz = min_t(size_t, buflen, PAGE_SIZE - (start & ~PAGE_MASK)); /* Calculate left bytes in current memory segment. */ nr_bytes = (curr_m->size - (start - curr_m->paddr)); -- 2.39.5