diff mbox

hw/intc/arm_gic_kvm: Fix build on aarch64

Message ID 20161011163202.19720-1-cov@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Christopher Covington Oct. 11, 2016, 4:32 p.m. UTC
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

Signed-off-by: Christopher Covington <cov@codeaurora.org>
---
 hw/intc/arm_gic_kvm.c | 14 --------------
 1 file changed, 14 deletions(-)

Comments

Peter Maydell Oct. 11, 2016, 4:43 p.m. UTC | #1
On 11 October 2016 at 17:32, Christopher Covington <cov@codeaurora.org> wrote:
> 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.

> Signed-off-by: Christopher Covington <cov@codeaurora.org>
> ---
>  hw/intc/arm_gic_kvm.c | 14 --------------
>  1 file changed, 14 deletions(-)
>
> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
> index ae7ac58..11729ee 100644
> --- a/hw/intc/arm_gic_kvm.c
> +++ b/hw/intc/arm_gic_kvm.c
> @@ -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)

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).

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Christopher Covington Oct. 11, 2016, 5:08 p.m. UTC | #2
On 10/11/2016 12:43 PM, Peter Maydell wrote:
> On 11 October 2016 at 17:32, Christopher Covington <cov@codeaurora.org> wrote:
>> 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.

From Fedora 25:
gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)

> 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).
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Thanks Peter!

Cov
diff mbox

Patch

diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
index ae7ac58..11729ee 100644
--- a/hw/intc/arm_gic_kvm.c
+++ b/hw/intc/arm_gic_kvm.c
@@ -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)