virtio_balloon: Fix endian bug
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 12 Apr 2012 05:36:34 +0000 (15:36 +1000)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 25 Apr 2012 06:13:59 +0000 (11:13 +0530)
commitd1b28b1d6f9e7cc48e4ce1cc570edda2b87ccec5
treef961cfece5d7823f41a2716263b35306f1a72833
parent87231d118427ec0644f6fab1e592972bfb393b56
virtio_balloon: Fix endian bug

Although virtio config space fields are usually in guest-native endian,
the spec for the virtio balloon device explicitly states that both fields
in its config space are little-endian.

However, the current virtio_balloon driver does not have a suitable endian
swap for the 'num_pages' field, although it does have one for the 'actual'
field.  This patch corrects the bug, adding sparse annotation while we're
at it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_balloon.c