ppc/pnv: fix compile breakage on old gcc
PATCH 1/1 ppc/pnv: fix compile breakage on old gcc
PnvChip is defined twice and this can confuse old compilers :
CC ppc64-softmmu/hw/ppc/pnv_xscom.o
In file included from qemu.git/hw/ppc/pnv.c:29:qemu.git/include/hw/ppc/pnv.h:60: error: redefinition of typedef ‘PnvChip’ qemu.git/include/hw/ppc/pnv_xscom.h:24: note: previous declaration of ‘PnvChip’ was here make[1]: *** [hw/ppc/pnv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
---
Tested with gcc version 4.4.7 20120313
hw/ppc/pnv_core.c | 1 + hw/ppc/pnv_lpc.c | 3 ++- hw/ppc/pnv_xscom.c | 2 +- include/hw/ppc/pnv.h | 1 - include/hw/ppc/pnv_xscom.h | 2 -- 5 files changed, 4 insertions(+), 5 deletions(-)
hw/ppc/pnv_core.c +1 -0
@@ -24,6 +24,7 @@#include "hw/ppc/ppc.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_core.h" +#include "hw/ppc/pnv_xscom.h" static void powernv_cpu_reset (void *opaque) {
hw/ppc/pnv_lpc.c +2 -1
@@ -23,8 +23,9 @@#include "qapi/error.h" #include "qemu/log.h" -#include "hw/ppc/pnv_lpc.h" #include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_lpc.h" +#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/fdt.h" #include <libfdt.h>
hw/ppc/pnv_xscom.c +1 -1
@@ -25,8 +25,8 @@#include "hw/sysbus.h" #include "hw/ppc/fdt.h" -#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_xscom.h" #include <libfdt.h>
include/hw/ppc/pnv.h +0 -1
@@ -21,7 +21,6 @@#include "hw/boards.h" #include "hw/sysbus.h" -#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/pnv_lpc.h" #define TYPE_PNV_CHIP "powernv-chip"
include/hw/ppc/pnv_xscom.h +0 -2
@@ -21,8 +21,6 @@#include "qom/object.h" -typedef struct PnvChip PnvChip ; -typedef struct PnvXScomInterface {Object parent; }PnvXScomInterface ;
Signature · 1 line
2.7.4
David Gibson
AppliedQuoted 10 lines · Cédric Le Goater
PnvChip is defined twice and this can confuse old compilers :
CC
ppc64-softmmu/hw/ppc/pnv_xscom.o
In file included fromqemu.git/hw/ppc/pnv.c:29:qemu.git/include/hw/ppc/pnv.h:60: error: redefinition of typedef ‘PnvChip’qemu.git/include/hw/ppc/pnv_xscom.h:24: note: previous declaration of ‘PnvChip’ was here make[1]: *** [hw/ppc/pnv.o] Error 1
make[1]: *** Waiting for unfinished jobs....Signed-off-by Cédric Le Goater <[email protected]>
Applied to ppc-for-2.8, thanks.
Quoted 77 lines
---
Tested with gcc version 4.4.7 20120313
hw/ppc/pnv_core.c | 1 + hw/ppc/pnv_lpc.c | 3 ++- hw/ppc/pnv_xscom.c | 2 +- include/hw/ppc/pnv.h | 1 - include/hw/ppc/pnv_xscom.h | 2 -- 5 files changed, 4 insertions(+), 5 deletions(-)hw/ppc/pnv_core.c +1
-0@@ -24,6 +24,7 @@#include "hw/ppc/ppc.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_core.h" +#include "hw/ppc/pnv_xscom.h" static void powernv_cpu_reset (void *opaque) {hw/ppc/pnv_lpc.c +2
-1@@ -23,8 +23,9 @@#include "qapi/error.h" #include "qemu/log.h" -#include "hw/ppc/pnv_lpc.h" #include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_lpc.h" +#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/fdt.h" #include <libfdt.h> hw/ppc/pnv_xscom.c +1
-1@@ -25,8 +25,8 @@#include "hw/sysbus.h" #include "hw/ppc/fdt.h" -#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/pnv.h" +#include "hw/ppc/pnv_xscom.h" #include <libfdt.h> include/hw/ppc/pnv.h +0
-1@@ -21,7 +21,6 @@#include "hw/boards.h" #include "hw/sysbus.h" -#include "hw/ppc/pnv_xscom.h" #include "hw/ppc/pnv_lpc.h" #define TYPE_PNV_CHIP "powernv-chip"include/hw/ppc/pnv_xscom.h +0
-2@@ -21,8 +21,6 @@#include "qom/object.h" -typedef struct PnvChip PnvChip ; -typedef struct PnvXScomInterface {Object parent; }PnvXScomInterface ;
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson