[PATCH 1/8] kexec_file: Remove unused members from struct kexec_buf.

Dave Young dyoung at redhat.com
Mon Jun 13 00:05:08 PDT 2016


On 06/12/16 at 12:10am, Thiago Jung Bauermann wrote:
> kexec_add_buffer uses kexec_buf.buffer and kexec_buf.bufsz to pass along
> its own arguments buffer and bufsz, but since they aren't used anywhere
> else, it's pointless.
> 
> Cc: Eric Biederman <ebiederm at xmission.com>
> Cc: kexec at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> ---
>  kernel/kexec_file.c     | 6 ++----
>  kernel/kexec_internal.h | 2 --
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index 01ab82a40d22..b6eec7527e9f 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -464,8 +464,6 @@ int kexec_add_buffer(struct kimage *image, char *buffer, unsigned long bufsz,
>  	memset(&buf, 0, sizeof(struct kexec_buf));
>  	kbuf = &buf;
>  	kbuf->image = image;
> -	kbuf->buffer = buffer;
> -	kbuf->bufsz = bufsz;
>  
>  	kbuf->memsz = ALIGN(memsz, PAGE_SIZE);
>  	kbuf->buf_align = max(buf_align, PAGE_SIZE);
> @@ -489,8 +487,8 @@ int kexec_add_buffer(struct kimage *image, char *buffer, unsigned long bufsz,
>  
>  	/* Found a suitable memory range */
>  	ksegment = &image->segment[image->nr_segments];
> -	ksegment->kbuf = kbuf->buffer;
> -	ksegment->bufsz = kbuf->bufsz;
> +	ksegment->kbuf = buffer;
> +	ksegment->bufsz = bufsz;
>  	ksegment->mem = kbuf->mem;
>  	ksegment->memsz = kbuf->memsz;
>  	image->nr_segments++;
> diff --git a/kernel/kexec_internal.h b/kernel/kexec_internal.h
> index 0a52315d9c62..eefd5bf960c2 100644
> --- a/kernel/kexec_internal.h
> +++ b/kernel/kexec_internal.h
> @@ -26,8 +26,6 @@ struct kexec_sha_region {
>   */
>  struct kexec_buf {
>  	struct kimage *image;
> -	char *buffer;
> -	unsigned long bufsz;
>  	unsigned long mem;
>  	unsigned long memsz;
>  	unsigned long buf_align;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

Acked-by: Dave Young <dyoung at redhat.com>

Thanks
Dave



More information about the kexec mailing list