From: Andrew Morton Date: Wed, 20 Feb 2013 02:15:58 +0000 (+1100) Subject: fs-proc-vmcorec-put-if-tests-in-the-top-of-the-while-loop-to-reduce-duplication-fix-fix X-Git-Tag: next-20130220~1^2~216 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3c149d20166d315e0ec9296689e62605e79343e7;p=karo-tx-linux.git 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 --- 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));