]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
virtio_balloon: Fix endian bug
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 12 Apr 2012 05:36:34 +0000 (15:36 +1000)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 15 Apr 2012 08:51:05 +0000 (11:51 +0300)
commit1a87228f5f1d316002c7c161316f5524592be766
tree3c852fe87074cdc40a3435e3c18233be3b3f23e3
parentc0aa3e0916d7e531e69b02e426f7162dfb1c6c0f
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