* [PATCH 4/4] purgatory/ppc64: Fix uninitialized warning
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
@ 2018-04-11 17:03 ` Geoff Levand
2018-04-11 17:03 ` [PATCH 3/4] kexec-elf-rel-ppc64: Fix cast from pointer warning Geoff Levand
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2018-04-11 17:03 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Petitboot
Fixes warnings like these when building kexec for powerpc (32 bit):
console-ppc64.c: warning: ‘*((void *)&buff+8)’ may be used uninitialized
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
purgatory/arch/ppc64/console-ppc64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/purgatory/arch/ppc64/console-ppc64.c b/purgatory/arch/ppc64/console-ppc64.c
index b80183c..2403312 100644
--- a/purgatory/arch/ppc64/console-ppc64.c
+++ b/purgatory/arch/ppc64/console-ppc64.c
@@ -29,7 +29,7 @@ extern int debug;
void putchar(int c)
{
- char buff[16];
+ char buff[16] = "";
unsigned long *lbuf = (unsigned long *)buff;
if (!debug) /* running on non pseries */
--
2.14.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] crashdump-ppc64: Fix integer truncation warning
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
2018-04-11 17:03 ` [PATCH 4/4] purgatory/ppc64: Fix uninitialized warning Geoff Levand
2018-04-11 17:03 ` [PATCH 3/4] kexec-elf-rel-ppc64: Fix cast from pointer warning Geoff Levand
@ 2018-04-11 17:03 ` Geoff Levand
2018-04-11 17:03 ` [PATCH 1/4] kexec: Fix printf warning Geoff Levand
2018-04-19 8:38 ` [PATCH 0/4] Fix ppc build warnings Simon Horman
4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2018-04-11 17:03 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Petitboot
Fixes warnings like these when building kexec for powerpc (32 bit):
crashdump-ppc64.h: warning: large integer implicitly truncated to unsigned type
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
kexec/arch/ppc64/crashdump-ppc64.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec/arch/ppc64/crashdump-ppc64.h b/kexec/arch/ppc64/crashdump-ppc64.h
index 87beb39..b0cba8a 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.h
+++ b/kexec/arch/ppc64/crashdump-ppc64.h
@@ -14,7 +14,7 @@ void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
#define VMALLOCBASE 0xD000000000000000ULL
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
-#define MAXMEM (-KERNELBASE-VMALLOCBASE)
+#define MAXMEM (-(unsigned long)(KERNELBASE-VMALLOCBASE))
#define COMMAND_LINE_SIZE 2048 /* from kernel */
/* Backup Region, First 64K of System RAM. */
--
2.14.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 0/4] Fix ppc build warnings
@ 2018-04-11 17:03 Geoff Levand
2018-04-11 17:03 ` [PATCH 4/4] purgatory/ppc64: Fix uninitialized warning Geoff Levand
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Geoff Levand @ 2018-04-11 17:03 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Petitboot
Hi Simon,
Here are a few fixups for warnings generated when building for 32 bit powerpc
with gcc-7.2.0.
-Geoff
The following changes since commit 090e8eceed79f3973fee600db3a355ce06530e40:
kexec-tools 2.0.17-rc1 (2018-04-10 11:20:00 +0200)
are available in the git repository at:
https://github.com/glevand/petitboot--kexec-tools.git for-merge-ppc-warn
for you to fetch changes up to a3c8c1d9fa406ff68484225fd9356ac82f8090b9:
purgatory/ppc64: Fix uninitialized warning (2018-04-11 09:44:50 -0700)
----------------------------------------------------------------
Geoff Levand (4):
kexec: Fix printf warning
crashdump-ppc64: Fix integer truncation warning
kexec-elf-rel-ppc64: Fix cast from pointer warning
purgatory/ppc64: Fix uninitialized warning
kexec/arch/ppc64/crashdump-ppc64.h | 2 +-
kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 2 +-
kexec/kexec.c | 3 ++-
purgatory/arch/ppc64/console-ppc64.c | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
--
2.14.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] kexec-elf-rel-ppc64: Fix cast from pointer warning
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
2018-04-11 17:03 ` [PATCH 4/4] purgatory/ppc64: Fix uninitialized warning Geoff Levand
@ 2018-04-11 17:03 ` Geoff Levand
2018-04-11 17:03 ` [PATCH 2/4] crashdump-ppc64: Fix integer truncation warning Geoff Levand
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2018-04-11 17:03 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Petitboot
Fixes warnings like these when building kexec for powerpc (32 bit):
kexec-elf-rel-ppc64.c: warning: cast from pointer to integer of different size
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
index 5f8e3f2..51b1354 100644
--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
@@ -104,7 +104,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
break;
case R_PPC64_REL32:
- *(uint32_t *)location = value - (uint32_t)(uint64_t)location;
+ *(uint32_t *)location = value - (uint32_t)location;
break;
case R_PPC64_TOC:
--
2.14.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/4] kexec: Fix printf warning
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
` (2 preceding siblings ...)
2018-04-11 17:03 ` [PATCH 2/4] crashdump-ppc64: Fix integer truncation warning Geoff Levand
@ 2018-04-11 17:03 ` Geoff Levand
2018-04-19 8:38 ` [PATCH 0/4] Fix ppc build warnings Simon Horman
4 siblings, 0 replies; 6+ messages in thread
From: Geoff Levand @ 2018-04-11 17:03 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Petitboot
Fixes warnings like these when building kexec for powerpc (32 bit):
kexec.c: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
kexec/kexec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 313d9fe..29fa5fa 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -20,6 +20,7 @@
*/
#define _GNU_SOURCE
+#include <inttypes.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@@ -1235,7 +1236,7 @@ static void print_crashkernel_region_size(void)
return;
}
- printf("%lu\n", (start != end) ? (end - start + 1) : 0UL);
+ printf("%" PRIu64 "\n", (start != end) ? (end - start + 1) : 0UL);
}
int main(int argc, char *argv[])
--
2.14.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] Fix ppc build warnings
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
` (3 preceding siblings ...)
2018-04-11 17:03 ` [PATCH 1/4] kexec: Fix printf warning Geoff Levand
@ 2018-04-19 8:38 ` Simon Horman
4 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2018-04-19 8:38 UTC (permalink / raw)
To: Geoff Levand; +Cc: kexec, Petitboot
On Wed, Apr 11, 2018 at 05:03:11PM +0000, Geoff Levand wrote:
> Hi Simon,
>
> Here are a few fixups for warnings generated when building for 32 bit powerpc
> with gcc-7.2.0.
Thanks, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-19 8:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-11 17:03 [PATCH 0/4] Fix ppc build warnings Geoff Levand
2018-04-11 17:03 ` [PATCH 4/4] purgatory/ppc64: Fix uninitialized warning Geoff Levand
2018-04-11 17:03 ` [PATCH 3/4] kexec-elf-rel-ppc64: Fix cast from pointer warning Geoff Levand
2018-04-11 17:03 ` [PATCH 2/4] crashdump-ppc64: Fix integer truncation warning Geoff Levand
2018-04-11 17:03 ` [PATCH 1/4] kexec: Fix printf warning Geoff Levand
2018-04-19 8:38 ` [PATCH 0/4] Fix ppc build warnings Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox