diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-10-14 07:41:51 (GMT) |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-10-17 00:25:37 (GMT) |
commit | 855e0c5288177bcb193f6f6316952d2490478e1c (patch) | |
tree | 7c5cfed44c9def1a7ca3388f37a9520de52af44b /drivers/scsi | |
parent | 0b90d0622ad290b3717a13489b396af52aea9d2d (diff) | |
download | linux-fsl-qoriq-855e0c5288177bcb193f6f6316952d2490478e1c.tar.xz |
virtio: use size-based config accessors.
This lets the transport do endian conversion if necessary, and insulates
the drivers from the difference.
Most drivers can use the simple helpers virtio_cread() and virtio_cwrite().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/virtio_scsi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 2a11039..e6bb235 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -710,19 +710,15 @@ static struct scsi_host_template virtscsi_host_template_multi = { #define virtscsi_config_get(vdev, fld) \ ({ \ typeof(((struct virtio_scsi_config *)0)->fld) __val; \ - vdev->config->get(vdev, \ - offsetof(struct virtio_scsi_config, fld), \ - &__val, sizeof(__val)); \ + virtio_cread(vdev, struct virtio_scsi_config, fld, &__val); \ __val; \ }) #define virtscsi_config_set(vdev, fld, val) \ - (void)({ \ + do { \ typeof(((struct virtio_scsi_config *)0)->fld) __val = (val); \ - vdev->config->set(vdev, \ - offsetof(struct virtio_scsi_config, fld), \ - &__val, sizeof(__val)); \ - }) + virtio_cwrite(vdev, struct virtio_scsi_config, fld, &__val); \ + } while(0) static void __virtscsi_set_affinity(struct virtio_scsi *vscsi, bool affinity) { |