From: Yousong Zhou <yszhou4tech@gmail.com>
To: kexec@lists.infradead.org
Cc: Yousong Zhou <yszhou4tech@gmail.com>, horms@verge.net.au
Subject: [PATCH 3/3] Fix a few compilation warnings.
Date: Sun, 1 Feb 2015 00:10:08 +0800 [thread overview]
Message-ID: <1422720608-28700-3-git-send-email-yszhou4tech@gmail.com> (raw)
In-Reply-To: <1422720608-28700-1-git-send-email-yszhou4tech@gmail.com>
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;
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
next prev parent reply other threads:[~2015-01-31 16:21 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 ` Yousong Zhou [this message]
2015-02-09 5:58 ` [PATCH 3/3] Fix a few compilation warnings Simon Horman
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=1422720608-28700-3-git-send-email-yszhou4tech@gmail.com \
--to=yszhou4tech@gmail.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/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