Skip to contentSkip to conversation

hw/intc/arm_gic_kvm: Fix build on aarch64

PATCH In review Christopher Covington 2 participants 3 messages Oct 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/arm_gic_kvm: Fix build on aarch64

Remove unused debugging code to fix native building on aarch64. Without this change, the following -Werr output inhibits make from completing.

qemu/hw/intc/arm_gic_kvm.c:38:18: error: debug_gic_kvm defined but not used [-Werror=unused-const-variable=]

   static const int debug_gic_kvm = 0;
                    ^~~~~~~~~~~~~

cc1: all warnings being treated as errors qemu/rules.mak:60: recipe for target 'hw/intc/arm_gic_kvm.o' failed make[1]: *** [hw/intc/arm_gic_kvm.o] Error 1 Makefile:205: recipe for target 'subdir-aarch64-softmmu' failed

---
 hw/intc/arm_gic_kvm.c | 14 --------------
 1 file changed, 14 deletions(-)
hw/intc/arm_gic_kvm.c +0 -14
index ae7ac58..11729ee 100644
@@ -30,20 +30,6 @@
 #include "gic_internal.h"
 #include "vgic_common.h"
 
-//#define DEBUG_GIC_KVM
-
-#ifdef DEBUG_GIC_KVM
-static const int debug_gic_kvm = 1;
-#else
-static const int debug_gic_kvm = 0;
-#endif
-
-#define DPRINTF(fmt, ...) do { \
-        if (debug_gic_kvm) { \
-            printf("arm_gic: " fmt , ## __VA_ARGS__); \
-        } \
-    } while (0)
-
 #define TYPE_KVM_ARM_GIC "kvm-arm-gic"
 #define KVM_ARM_GIC(obj) \
      OBJECT_CHECK(GICState, (obj), TYPE_KVM_ARM_GIC)
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora
Forum, a Linux Foundation Collaborative Project.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Christopher Covington

Remove unused debugging code to fix native building on aarch64. Without this change, the following -Werr output inhibits make from completing.

qemu/hw/intc/arm_gic_kvm.c:38:18: error: debug_gic_kvm defined but not used [-Werror=unused-const-variable=]

   static const int debug_gic_kvm = 0;
                    ^~~~~~~~~~~~~

cc1: all warnings being treated as errors qemu/rules.mak:60: recipe for target 'hw/intc/arm_gic_kvm.o' failed make[1]: *** [hw/intc/arm_gic_kvm.o] Error 1 Makefile:205: recipe for target 'subdir-aarch64-softmmu' failed

This builds for me on aarch64, so presumably this is a "newer compiler is more picky" warning.

Quoted 20 lines
---
 hw/intc/arm_gic_kvm.c | 14 --------------
 1 file changed, 14 deletions(-)
hw/intc/arm_gic_kvm.c +0 -7
index ae7ac58..11729ee 100644
@@ -30,20 +30,6 @@
 #include "gic_internal.h"
 #include "vgic_common.h"
 
-//#define DEBUG_GIC_KVM
-
-#ifdef DEBUG_GIC_KVM
-static const int debug_gic_kvm = 1;
-#else
-static const int debug_gic_kvm = 0;
-#endif

hw/intc/arm_gic_kvm.c line 35

Quoted 10 lines
hw/intc/arm_gic_kvm.c +0 -7
-
-#define DPRINTF(fmt, ...) do { \
-        if (debug_gic_kvm) { \
-            printf("arm_gic: " fmt , ## __VA_ARGS__); \
-        } \
-    } while (0)
-
 #define TYPE_KVM_ARM_GIC "kvm-arm-gic"
 #define KVM_ARM_GIC(obj) \
      OBJECT_CHECK(GICState, (obj), TYPE_KVM_ARM_GIC)

In any case, since we don't use the DPRINTF macro we may as well dump it (we should use tracepoints if we want to add interesting debug-logging in future anyhow).

thanks
-- PMM

#2 lore raw
Quoted 12 lines · Peter Maydell
Quoted 10 lines · Christopher Covington

Remove unused debugging code to fix native building on aarch64. Without this change, the following -Werr output inhibits make from completing.

qemu/hw/intc/arm_gic_kvm.c:38:18: error: debug_gic_kvm defined but not used [-Werror=unused-const-variable=]

   static const int debug_gic_kvm = 0;
                    ^~~~~~~~~~~~~

cc1: all warnings being treated as errors qemu/rules.mak:60: recipe for target 'hw/intc/arm_gic_kvm.o' failed make[1]: *** [hw/intc/arm_gic_kvm.o] Error 1 Makefile:205: recipe for target 'subdir-aarch64-softmmu' failed

Quoted 4 lines

This builds for me on aarch64, so presumably this is a "newer compiler is more picky" warning.

From Fedora 25:

gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)

Quoted 5 lines

In any case, since we don't use the DPRINTF macro we may as well dump it (we should use tracepoints if we want to add interesting debug-logging in future anyhow).

Thanks Peter!

Cov

Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.