qemu-e2k/hw/scsi
Peter Maydell 9786650866 hw/scsi/mptendian: Avoid taking address of fields in packed structs
Taking the address of a field in a packed struct is a bad idea, because
it might not be actually aligned enough for that pointer type (and
thus cause a crash on dereference on some host architectures). Newer
versions of clang warn about this. Avoid the bug by not using the
"modify in place" byte swapping functions.

This patch was produced with the following simple spatch script:
@@
expression E;
@@
-le16_to_cpus(&E);
+E = le16_to_cpu(E);
@@
expression E;
@@
-le32_to_cpus(&E);
+E = le32_to_cpu(E);
@@
expression E;
@@
-le64_to_cpus(&E);
+E = le64_to_cpu(E);
@@
expression E;
@@
-cpu_to_le16s(&E);
+E = cpu_to_le16(E);
@@
expression E;
@@
-cpu_to_le32s(&E);
+E = cpu_to_le32(E);
@@
expression E;
@@
-cpu_to_le64s(&E);
+E = cpu_to_le64(E);

followed by some minor tidying of overlong lines and bad indent.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180927134852.21490-1-peter.maydell@linaro.org>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-10-02 19:09:14 +02:00
..
esp-pci.c
esp.c esp: remove legacy esp_init() function 2018-06-28 19:05:36 +02:00
lsi53c895a.c lsi53c895a: convert to trace-events 2018-10-02 19:09:13 +02:00
Makefile.objs hw: make virtio devices configurable via default-configs/ 2018-06-01 15:14:31 +02:00
megasas.c megasas: fix sglist leak 2018-08-23 13:32:50 +02:00
mfi.h
mpi.h
mptconfig.c
mptendian.c hw/scsi/mptendian: Avoid taking address of fields in packed structs 2018-10-02 19:09:14 +02:00
mptsas.c scsi: mptsas: Mark as storage device 2018-08-23 13:32:50 +02:00
mptsas.h
scsi-bus.c usb-storage: Add rerror/werror properties 2018-06-29 14:20:56 +02:00
scsi-disk.c scsi-block: Deprecate rotation_rate 2018-10-02 19:09:13 +02:00
scsi-generic.c hw/scsi: add VPD Block Limits emulation 2018-06-29 13:02:50 +02:00
spapr_vscsi.c
srp.h
trace-events lsi53c895a: convert to trace-events 2018-10-02 19:09:13 +02:00
vhost-scsi-common.c vhost-scsi: unify vhost-scsi get_features implementations 2018-08-23 18:46:25 +02:00
vhost-scsi.c vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI 2018-08-23 18:46:25 +02:00
vhost-user-scsi.c vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI 2018-08-23 18:46:25 +02:00
viosrp.h
virtio-scsi-dataplane.c Replace '-enable-kvm' with '-accel kvm' in docs and help texts 2018-06-28 19:05:32 +02:00
virtio-scsi.c virtio-scsi: fix hotplug ->reset() vs event race 2018-07-16 16:58:16 +02:00
vmw_pvscsi.c
vmw_pvscsi.h