* [Qemu-devel] [PULL 0/2] virtio-input: two fixes
@ 2015-06-02 8:36 Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant Gerd Hoffmann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-06-02 8:36 UTC (permalink / raw)
To: qemu-devel; +Cc: 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
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(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant
2015-06-02 8:36 [Qemu-devel] [PULL 0/2] virtio-input: two fixes Gerd Hoffmann
@ 2015-06-02 8:36 ` Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 2/2] virtio-input: make virtio devices follow usual naming convention Gerd Hoffmann
2015-06-02 12:20 ` [Qemu-devel] [PULL 0/2] virtio-input: two fixes Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-06-02 8:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Mueller, Gerd Hoffmann
From: Michael Mueller <mimu@linux.vnet.ibm.com>
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’)
...
Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/virtio/virtio-input.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index a265519..bcee355 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] virtio-input: make virtio devices follow usual naming convention
2015-06-02 8:36 [Qemu-devel] [PULL 0/2] virtio-input: two fixes Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant Gerd Hoffmann
@ 2015-06-02 8:36 ` Gerd Hoffmann
2015-06-02 12:20 ` [Qemu-devel] [PULL 0/2] virtio-input: two fixes Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-06-02 8:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/virtio/virtio-input.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index bcee355..8134178 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] virtio-input: two fixes
2015-06-02 8:36 [Qemu-devel] [PULL 0/2] virtio-input: two fixes Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 2/2] virtio-input: make virtio devices follow usual naming convention Gerd Hoffmann
@ 2015-06-02 12:20 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-06-02 12:20 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 2 June 2015 at 09:36, Gerd Hoffmann <kraxel@redhat.com> wrote:
> 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(-)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-02 12:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 8:36 [Qemu-devel] [PULL 0/2] virtio-input: two fixes Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 1/2] virtio-input: const_le16 and const_le32 not build time constant Gerd Hoffmann
2015-06-02 8:36 ` [Qemu-devel] [PULL 2/2] virtio-input: make virtio devices follow usual naming convention Gerd Hoffmann
2015-06-02 12:20 ` [Qemu-devel] [PULL 0/2] virtio-input: two fixes Peter Maydell
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).