aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/virtio/virtio-balloon.c2
-rw-r--r--ui/input.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index c2c446eb9b..76e32ceef8 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -275,7 +275,7 @@ static void virtio_balloon_set_config(VirtIODevice *vdev,
dev->actual = le32_to_cpu(config.actual);
if (dev->actual != oldactual) {
qemu_balloon_changed(ram_size -
- (dev->actual << VIRTIO_BALLOON_PFN_SHIFT));
+ ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT));
}
}
diff --git a/ui/input.c b/ui/input.c
index 9abef0cd78..ecfeb43824 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -234,13 +234,11 @@ static void free_keycodes(void)
static void release_keys(void *opaque)
{
- int i;
-
- for (i = 0; i < keycodes_size; i++) {
- if (keycodes[i] & 0x80) {
+ while (keycodes_size > 0) {
+ if (keycodes[--keycodes_size] & 0x80) {
kbd_put_keycode(0xe0);
}
- kbd_put_keycode(keycodes[i]| 0x80);
+ kbd_put_keycode(keycodes[keycodes_size] | 0x80);
}
free_keycodes();