Skip to contentSkip to conversation

virtio-input: two fixes

GIT PULL Applied Gerd Hoffmann 2 participants 4 messages Jun 2, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

Two small incremental fixes for virtio-input. One of them fixes a build failure in bigendian machines: gcc can't evaluate bswap32(const) to a compile-time constant. So this is a bit urgent ...

please pull,
Gerd

The following changes since commit b821cbe274c5a5cacf1a7b28360d869ae1e6e0c3:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-06-01 15:22:46 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-input-20150602-1

for you to fetch changes up to e63d114b8a81e22ff9295674ba64b21255d589ee:

virtio-input: make virtio devices follow usual naming convention (2015-06-02 10:31:29 +0200)

----------------------------------------------------------------
virtio-input: two small fixups

----------------------------------------------------------------
Gerd Hoffmann (1):
virtio-input: make virtio devices follow usual naming convention

Michael Mueller (1):
virtio-input: const_le16 and const_le32 not build time constant

 include/hw/virtio/virtio-input.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant

From: Michael Mueller <[email protected]>

As the implementation of const_le16 and const_le32 is not build time constant on big endian systems this need to be fixed.

CC hw/input/virtio-input-hid.o
hw/input/virtio-input-hid.c:340:13: error: initializer element is not constant hw/input/virtio-input-hid.c:340:13: error: (near initialization for ‘virtio_keyboard_config[1].u.ids.bustype’)
...

---
 include/hw/virtio/virtio-input.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
include/hw/virtio/virtio-input.h +8 -2
index a265519..bcee355 100644
@@ -14,8 +14,14 @@ typedef struct virtio_input_config virtio_input_config;
 typedef struct virtio_input_event virtio_input_event;
 
 #if defined(HOST_WORDS_BIGENDIAN)
-# define const_le32(_x) bswap32(_x)
-# define const_le16(_x) bswap32(_x)
+# define const_le32(_x)                          \
+    (((_x & 0x000000ffU) << 24) |                \
+     ((_x & 0x0000ff00U) <<  8) |                \
+     ((_x & 0x00ff0000U) >>  8) |                \
+     ((_x & 0xff000000U) >> 24))
+# define const_le16(_x)                          \
+    (((_x & 0x00ff) << 8) |                      \
+     ((_x & 0xff00) >> 8))
 #else
 # define const_le32(_x) (_x)
 # define const_le16(_x) (_x)
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 2/2] virtio-input: make virtio devices follow usual naming convention

In reply to Gerd Hoffmann
---
 include/hw/virtio/virtio-input.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/hw/virtio/virtio-input.h +4 -4
index bcee355..8134178 100644
@@ -40,10 +40,10 @@ typedef struct virtio_input_event virtio_input_event;
 #define VIRTIO_INPUT_CLASS(klass) \
         OBJECT_CLASS_CHECK(VirtIOInputClass, klass, TYPE_VIRTIO_INPUT)
 
-#define TYPE_VIRTIO_INPUT_HID "virtio-input-hid"
-#define TYPE_VIRTIO_KEYBOARD  "virtio-keyboard"
-#define TYPE_VIRTIO_MOUSE     "virtio-mouse"
-#define TYPE_VIRTIO_TABLET    "virtio-tablet"
+#define TYPE_VIRTIO_INPUT_HID "virtio-input-hid-device"
+#define TYPE_VIRTIO_KEYBOARD  "virtio-keyboard-device"
+#define TYPE_VIRTIO_MOUSE     "virtio-mouse-device"
+#define TYPE_VIRTIO_TABLET    "virtio-tablet-device"
 
 #define VIRTIO_INPUT_HID(obj) \
         OBJECT_CHECK(VirtIOInputHID, (obj), TYPE_VIRTIO_INPUT_HID)
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 29 lines · Gerd Hoffmann

Hi,

Two small incremental fixes for virtio-input. One of them fixes a build failure in bigendian machines: gcc can't evaluate bswap32(const) to a compile-time constant. So this is a bit urgent ...

please pull,
Gerd

The following changes since commit b821cbe274c5a5cacf1a7b28360d869ae1e6e0c3:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-06-01 15:22:46 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-input-20150602-1

for you to fetch changes up to e63d114b8a81e22ff9295674ba64b21255d589ee:

virtio-input: make virtio devices follow usual naming convention (2015-06-02 10:31:29 +0200)

----------------------------------------------------------------
virtio-input: two small fixups

----------------------------------------------------------------
Gerd Hoffmann (1):
virtio-input: make virtio devices follow usual naming convention

Quoted 5 lines

Michael Mueller (1):
virtio-input: const_le16 and const_le32 not build time constant

 include/hw/virtio/virtio-input.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Applied, thanks.

-- PMM