[Qemu-devel] [PATCH] ppc: avoid typedef redefinitions

Paolo Bonzini posted 1 patch 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1488558530-21016-3-git-send-email-pbonzini@redhat.com
Test checkpatch passed
Test docker passed
include/hw/ppc/spapr.h | 1 -
include/hw/ppc/xics.h  | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
[Qemu-devel] [PATCH] ppc: avoid typedef redefinitions
Posted by Paolo Bonzini 7 years, 1 month ago
These cause compilation failures on CentOS 6 or other operating
systems with older GCCs.

Cc: David Gibson <dgibson@redhat.com>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
	It would probably be better to remove the
	sPAPRMachineState typedef from xics.h instead,
	but this is a quick fix to restore the centos6
	docker target.

 include/hw/ppc/spapr.h | 1 -
 include/hw/ppc/xics.h  | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index cfd2711..15f4371 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -21,7 +21,6 @@ typedef struct sPAPREventSource sPAPREventSource;
 #define SPAPR_TIMEBASE_FREQ     512000000ULL
 
 typedef struct sPAPRMachineClass sPAPRMachineClass;
-typedef struct sPAPRMachineState sPAPRMachineState;
 
 #define TYPE_SPAPR_MACHINE      "spapr-machine"
 #define SPAPR_MACHINE(obj) \
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 1945913..9a5e715 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -139,9 +139,9 @@ struct ICSIRQState {
     uint8_t flags;
 };
 
-typedef struct XICSFabric {
+struct XICSFabric {
     Object parent;
-} XICSFabric;
+};
 
 #define TYPE_XICS_FABRIC "xics-fabric"
 #define XICS_FABRIC(obj)                                     \
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] ppc: avoid typedef redefinitions
Posted by Peter Maydell 7 years, 1 month ago
On 3 March 2017 at 16:28, Paolo Bonzini <pbonzini@redhat.com> wrote:
> These cause compilation failures on CentOS 6 or other operating
> systems with older GCCs.
>
> Cc: David Gibson <dgibson@redhat.com>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>         It would probably be better to remove the
>         sPAPRMachineState typedef from xics.h instead,
>         but this is a quick fix to restore the centos6
>         docker target.
>
>  include/hw/ppc/spapr.h | 1 -
>  include/hw/ppc/xics.h  | 4 ++--
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index cfd2711..15f4371 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -21,7 +21,6 @@ typedef struct sPAPREventSource sPAPREventSource;
>  #define SPAPR_TIMEBASE_FREQ     512000000ULL
>
>  typedef struct sPAPRMachineClass sPAPRMachineClass;
> -typedef struct sPAPRMachineState sPAPRMachineState;
>
>  #define TYPE_SPAPR_MACHINE      "spapr-machine"
>  #define SPAPR_MACHINE(obj) \
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 1945913..9a5e715 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -139,9 +139,9 @@ struct ICSIRQState {
>      uint8_t flags;
>  };
>
> -typedef struct XICSFabric {
> +struct XICSFabric {
>      Object parent;
> -} XICSFabric;
> +};
>
>  #define TYPE_XICS_FABRIC "xics-fabric"
>  #define XICS_FABRIC(obj)                                     \
> --
> 1.8.3.1

Applied to master as a buildfix, thanks.

-- PMM