Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Yousong Zhou <yszhou4tech@gmail.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH 3/3] Fix a few compilation warnings.
Date: Mon, 9 Feb 2015 14:58:08 +0900	[thread overview]
Message-ID: <20150209055808.GC29385@verge.net.au> (raw)
In-Reply-To: <1422720608-28700-3-git-send-email-yszhou4tech@gmail.com>

These changes do not seem to be related to each other.
Please split this into 4 separate patches each with
a changelog that briefly describes what the problem is.

On Sun, Feb 01, 2015 at 12:10:08AM +0800, Yousong Zhou wrote:
> 
> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> ---
>  kexec/arch/mips/crashdump-mips.c |    3 ++-
>  kexec/arch/mips/kexec-elf-mips.c |    2 +-
>  kexec/kexec-elf-rel.c            |    3 +++
>  kexec/kexec.h                    |    2 +-
>  4 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
> index e7840e0..98c9f7c 100644
> --- a/kexec/arch/mips/crashdump-mips.c
> +++ b/kexec/arch/mips/crashdump-mips.c
> @@ -22,6 +22,7 @@
>  #include <stdlib.h>
>  #include <errno.h>
>  #include <limits.h>
> +#include <inttypes.h>
>  #include <elf.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> @@ -52,7 +53,7 @@ static int get_kernel_paddr(struct crash_elf_info *elf_info)
>  
>  	if (parse_iomem_single("Kernel code\n", &start, NULL) == 0) {
>  		elf_info->kern_paddr_start = start;
> -		dbgprintf("kernel load physical addr start = 0x%lx\n", start);
> +		dbgprintf("kernel load physical addr start = 0x%" PRIu64 "\n", start);
>  		return 0;
>  	}
>  
> diff --git a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c
> index a27d986..8a6419a 100644
> --- a/kexec/arch/mips/kexec-elf-mips.c
> +++ b/kexec/arch/mips/kexec-elf-mips.c
> @@ -158,7 +158,7 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
>  	if (info->kexec_flags & KEXEC_ON_CRASH)
>  		/* In case of crashdump segment[0] is kernel.
>  		 * Put cmdline just after it. */
> -		cmdline_addr = info->segment[0].mem +
> +		cmdline_addr = (unsigned long)info->segment[0].mem +
>  				info->segment[0].memsz;

I wonder if we can resolve this without resorting to a cast.

>  	else
>  		cmdline_addr = 0;
> diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
> index c625f30..5a5fcd1 100644
> --- a/kexec/kexec-elf-rel.c
> +++ b/kexec/kexec-elf-rel.c
> @@ -347,6 +347,9 @@ int elf_rel_load(struct mem_ehdr *ehdr, struct kexec_info *info,
>  			else if (shdr->sh_type == SHT_RELA) {
>  				rel = elf_rela(ehdr, ptr);
>  			}
> +			else {
> +				die("Unexpected sh_type: %d\n", shdr->sh_type);
> +			}
>  			/* the location to change */
>  			location = section->sh_data + rel.r_offset;
>  
> diff --git a/kexec/kexec.h b/kexec/kexec.h
> index 4be2b2f..2c85052 100644
> --- a/kexec/kexec.h
> +++ b/kexec/kexec.h
> @@ -245,7 +245,7 @@ extern int file_types;
>  
>  extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
>  extern void die(const char *fmt, ...)
> -	__attribute__ ((format (printf, 1, 2)));
> +	__attribute__ ((format (printf, 1, 2), noreturn));
>  extern void *xmalloc(size_t size);
>  extern void *xrealloc(void *ptr, size_t size);
>  extern char *slurp_file(const char *filename, off_t *r_size);
> -- 
> 1.7.10.4
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-02-09  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31 16:10 [PATCH 1/3] configure.ac: quote result of AC_CHECK_LIB() Yousong Zhou
2015-01-31 16:10 ` [PATCH 2/3] Fix zlib/lzma decompression Yousong Zhou
2015-02-09  6:00   ` Simon Horman
2015-01-31 16:10 ` [PATCH 3/3] Fix a few compilation warnings Yousong Zhou
2015-02-09  5:58   ` Simon Horman [this message]
2015-02-09 12:56     ` Yousong Zhou
2015-02-10  0:14       ` Simon Horman
2015-02-09  5:56 ` [PATCH 1/3] configure.ac: quote result of AC_CHECK_LIB() Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150209055808.GC29385@verge.net.au \
    --to=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=yszhou4tech@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox