kexec: remove never used member destination in kimage
authorBaoquan He <bhe@redhat.com>
Tue, 17 Feb 2015 21:45:44 +0000 (13:45 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Feb 2015 22:34:51 +0000 (14:34 -0800)
struct kimage has a member destination which is used to store the real
destination address of each page when load segment from user space buffer
to kernel.  But we never retrieve the value stored in kimage->destination,
so this member variable in kimage and its assignment operation are
redundent code.

I guess for_each_kimage_entry just does the work that kimage->destination
is expected to do.

So in this patch just make a cleanup to remove it.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/kexec.h
kernel/kexec.c

index 9d957b7ae095ed7f2980db140a9c21a6aae70084..10da8e246317df4342908ed967a26b7fcedb172e 100644 (file)
@@ -122,8 +122,6 @@ struct kimage {
        kimage_entry_t *entry;
        kimage_entry_t *last_entry;
 
-       unsigned long destination;
-
        unsigned long start;
        struct page *control_code_page;
        struct page *swap_page;
index c85277639b34ff220618d973ec8b84df557434e2..35dcac4b5c1c23474e423de65949c38c5d2805d8 100644 (file)
@@ -856,8 +856,6 @@ static int kimage_set_destination(struct kimage *image,
 
        destination &= PAGE_MASK;
        result = kimage_add_entry(image, destination | IND_DESTINATION);
-       if (result == 0)
-               image->destination = destination;
 
        return result;
 }
@@ -869,8 +867,6 @@ static int kimage_add_page(struct kimage *image, unsigned long page)
 
        page &= PAGE_MASK;
        result = kimage_add_entry(image, page | IND_SOURCE);
-       if (result == 0)
-               image->destination += PAGE_SIZE;
 
        return result;
 }