virtio: mmio: fix signature checking for BE guests
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 5 Nov 2013 10:51:28 +0000 (21:21 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 7 Nov 2013 01:43:04 +0000 (12:13 +1030)
commit4ae85370720156025e9cb873c13a0afb06ca1612
tree3f2fc075e48cdfb64df2dd659a3acc656308f18a
parent2342d6a6512ce5a3d2433bf77e6580e738cfd709
virtio: mmio: fix signature checking for BE guests

As virtio-mmio config registers are specified to be little-endian,
using readl() to read the magic value and then memcmp() to check it
fails on BE (as readl() has an implicit swab).

Fix it by encoding the magic value as an integer instead of a string.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_mmio.c