mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
virtio: change config to guest endian.
A recent proposed feature addition to the virtio block driver revealed some flaws in the API, in particular how easy it is to break big endian machines. The virtio config space was originally chosen to be little-endian, because we thought the config might be part of the PCI config space for virtio_pci. It's actually a separate mmio region, so that argument holds little water; as only x86 is currently using the virtio mechanism, we can change this (but must do so now, before the impending s390 merge). API changes: - __virtio_config_val() just becomes a striaght vdev->config_get() call. Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
5539ae9613
commit
72e61eb40b
3 changed files with 21 additions and 36 deletions
|
|
@ -246,8 +246,8 @@ static int virtblk_probe(struct virtio_device *vdev)
|
|||
blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
|
||||
|
||||
/* Host must always specify the capacity. */
|
||||
__virtio_config_val(vdev, offsetof(struct virtio_blk_config, capacity),
|
||||
&cap);
|
||||
vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity),
|
||||
&cap, sizeof(cap));
|
||||
|
||||
/* If capacity is too big, truncate with warning. */
|
||||
if ((sector_t)cap != cap) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue