]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kexec-use-min_t-to-simplify-logic-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Mar 2013 04:08:33 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:34:30 +0000 (16:34 +1100)
replace min_t with min, remove unneeded casts

Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Joe Perches <joe@perches.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kexec.c

index 97096351de18f0eb0b69f2bc3f2d1f6376172c4a..38f5fab4d5eb39330232c4c3084601eb5f3c0e3c 100644 (file)
@@ -820,8 +820,8 @@ static int kimage_load_normal_segment(struct kimage *image,
                clear_page(ptr);
                ptr += maddr & ~PAGE_MASK;
                mchunk = min_t(size_t, mbytes,
-                              (size_t)(PAGE_SIZE - (maddr & ~PAGE_MASK)));
-               uchunk = min_t(size_t, ubytes, mchunk);
+                               PAGE_SIZE - (maddr & ~PAGE_MASK));
+               uchunk = min(ubytes, mchunk);
 
                result = copy_from_user(ptr, buf, uchunk);
                kunmap(page);
@@ -868,8 +868,8 @@ static int kimage_load_crash_segment(struct kimage *image,
                ptr = kmap(page);
                ptr += maddr & ~PAGE_MASK;
                mchunk = min_t(size_t, mbytes,
-                              (size_t)(PAGE_SIZE - (maddr & ~PAGE_MASK)));
-               uchunk = min_t(size_t, ubytes, mchunk);
+                               PAGE_SIZE - (maddr & ~PAGE_MASK));
+               uchunk = min(ubytes, mchunk);
                if (mchunk > uchunk) {
                        /* Zero the trailing part of the page */
                        memset(ptr + uchunk, 0, mchunk - uchunk);
@@ -1447,7 +1447,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
        r = vsnprintf(buf, sizeof(buf), fmt, args);
        va_end(args);
 
-       r = min_t(size_t, r, vmcoreinfo_max_size - vmcoreinfo_size);
+       r = min(r, vmcoreinfo_max_size - vmcoreinfo_size);
 
        memcpy(&vmcoreinfo_data[vmcoreinfo_size], buf, r);