avoid `if (foo = bar)' thing, use min_t()
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
return -EINVAL;
while (buflen) {
- if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
- tsz = buflen;
+ tsz = max_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));