From: Scott Wood <scottwood@freescale.com>
To: Simon Horman <horms@verge.net.au>
Cc: <kexec@lists.infradead.org>, <linuxppc-dev@lists.ozlabs.org>,
"Michael Ellerman" <mpe@ellerman.id.au>,
Scott Wood <scottwood@freescale.com>
Subject: [PATCH v2 1/3] ppc64: Fix warnings
Date: Tue, 6 Oct 2015 17:55:48 -0500 [thread overview]
Message-ID: <1444172150-29493-1-git-send-email-scottwood@freescale.com> (raw)
Produce a warning-free build on ppc64 (at least, when built as 64-bit
userspace -- if a 64-bit binary for ppc64 is a requirement, why is -m64
set only on purgatory?). Mostly unused (or write-only) variable
warnings, but also one nasty one where reserve() was used without a
prototype, causing long long arguments to be passed as int.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v2: no change
kexec/arch/ppc64/crashdump-ppc64.c | 3 ++-
kexec/arch/ppc64/kexec-elf-ppc64.c | 9 +--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 6214b83..b3c8928 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -33,6 +33,7 @@
#include "../../kexec-syscall.h"
#include "../../crashdump.h"
#include "kexec-ppc64.h"
+#include "../../fs2dt.h"
#include "crashdump-ppc64.h"
static struct crash_elf_info elf_info64 =
@@ -187,7 +188,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
DIR *dir, *dmem;
FILE *file;
struct dirent *dentry, *mentry;
- int i, n, crash_rng_len = 0;
+ int n, crash_rng_len = 0;
unsigned long long start, end;
int page_size;
diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 4a1540e..adcee4c 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -97,7 +97,6 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
struct mem_ehdr ehdr;
char *cmdline, *modified_cmdline = NULL;
const char *devicetreeblob;
- int cmdline_len, modified_cmdline_len;
uint64_t max_addr, hole_addr;
char *seg_buf = NULL;
off_t seg_size = 0;
@@ -107,7 +106,6 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
uint64_t *rsvmap_ptr;
struct bootblock *bb_ptr;
#endif
- int i;
int result, opt;
uint64_t my_kernel, my_dt_offset;
uint64_t my_opal_base = 0, my_opal_entry = 0;
@@ -162,10 +160,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
}
}
- cmdline_len = 0;
- if (cmdline)
- cmdline_len = strlen(cmdline) + 1;
- else
+ if (!cmdline)
fprintf(stdout, "Warning: append= option is not passed. Using the first kernel root partition\n");
if (ramdisk && reuse_initrd)
@@ -181,7 +176,6 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
strncpy(modified_cmdline, cmdline, COMMAND_LINE_SIZE);
modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0';
}
- modified_cmdline_len = strlen(modified_cmdline);
}
/* Parse the Elf file */
@@ -219,7 +213,6 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
return -1;
/* Use new command line. */
cmdline = modified_cmdline;
- cmdline_len = strlen(modified_cmdline) + 1;
}
/* Add v2wrap to the current image */
--
2.1.4
next reply other threads:[~2015-10-06 22:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 22:55 Scott Wood [this message]
2015-10-06 22:55 ` [PATCH v2 2/3] ppc64: Avoid rfid if no need to clear MSR_LE Scott Wood
2015-10-16 1:48 ` Simon Horman
2015-10-30 0:16 ` Scott Wood
2015-11-01 22:55 ` Sam Mendoza-Jonas
2015-11-02 0:21 ` Sam Mendoza-Jonas
2015-11-02 2:06 ` Simon Horman
2015-10-06 22:55 ` [PATCH v2 3/3] ppc64: Add a flag to tell the kernel it's booting from kexec Scott Wood
2015-10-16 1:48 ` Simon Horman
2015-12-07 20:42 ` Scott Wood
2015-12-08 3:46 ` Michael Ellerman
2015-12-08 6:01 ` Simon Horman
2015-10-16 1:47 ` [PATCH v2 1/3] ppc64: Fix warnings 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=1444172150-29493-1-git-send-email-scottwood@freescale.com \
--to=scottwood@freescale.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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;
as well as URLs for NNTP newsgroup(s).