From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
peter.maydell@linaro.org, agraf@suse.de, aliguori@amazon.com,
borntraeger@de.ibm.com
Subject: [Qemu-devel] [PULL 1/9] kvm: Fix enable_cap helpers on older gcc
Date: Tue, 20 May 2014 13:44:54 +0200 [thread overview]
Message-ID: <1400586302-3253-2-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1400586302-3253-1-git-send-email-cornelia.huck@de.ibm.com>
From: Alexander Graf <agraf@suse.de>
Commit 40f1ee27aa1 introduced handy helpers for enable_cap calls on
vcpu and vm level. Unfortunately some older gcc versions (4.7.1, 4.6)
seem to choke on signedness detection in inline created variables:
target-ppc/kvm.c: In function 'kvmppc_booke_watchdog_enable':
target-ppc/kvm.c:1302:21: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
target-ppc/kvm.c: In function 'kvmppc_set_papr':
target-ppc/kvm.c:1504:21: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
However - thanks to Thomas Huth for the suggestion - we can just cast the
offending potentially 0 value to a signed type, making the comparison signed.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
include/sysemu/kvm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index e7ad9d1..25c8a2b 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -300,7 +300,7 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
}; \
uint64_t args_tmp[] = { __VA_ARGS__ }; \
int i; \
- for (i = 0; i < ARRAY_SIZE(args_tmp) && \
+ for (i = 0; i < (int)ARRAY_SIZE(args_tmp) && \
i < ARRAY_SIZE(cap.args); i++) { \
cap.args[i] = args_tmp[i]; \
} \
@@ -315,7 +315,7 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
}; \
uint64_t args_tmp[] = { __VA_ARGS__ }; \
int i; \
- for (i = 0; i < ARRAY_SIZE(args_tmp) && \
+ for (i = 0; i < (int)ARRAY_SIZE(args_tmp) && \
i < ARRAY_SIZE(cap.args); i++) { \
cap.args[i] = args_tmp[i]; \
} \
--
1.7.9.5
next prev parent reply other threads:[~2014-05-20 11:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 11:44 [Qemu-devel] [PULL 0/9] s390 patches for 2014/05/20 Cornelia Huck
2014-05-20 11:44 ` Cornelia Huck [this message]
2014-05-20 11:44 ` [Qemu-devel] [PULL 2/9] s390x: split flic into kvm and non-kvm parts Cornelia Huck
2014-05-20 11:44 ` [Qemu-devel] [PULL 3/9] s390x: add I/O adapter registration Cornelia Huck
2014-05-20 11:44 ` [Qemu-devel] [PULL 4/9] s390x/virtio-ccw: reference-counted indicators Cornelia Huck
2014-05-20 11:44 ` [Qemu-devel] [PULL 5/9] s390x/virtio-ccw: wire up irq routing and irqfds Cornelia Huck
2014-05-20 11:44 ` [Qemu-devel] [PULL 6/9] linux-headers: update Cornelia Huck
2014-05-20 11:45 ` [Qemu-devel] [PULL 7/9] s390x: remove duplicate definitions of DIAG 501 Cornelia Huck
2014-05-20 11:45 ` [Qemu-devel] [PULL 8/9] s390x/kvm: software breakpoint support Cornelia Huck
2014-05-20 11:45 ` [Qemu-devel] [PULL 9/9] s390x/kvm: hw debugging support via guest PER facility Cornelia Huck
2014-05-22 16:05 ` [Qemu-devel] [PULL 0/9] s390 patches for 2014/05/20 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400586302-3253-2-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=borntraeger@de.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).