qemu-e2k/hw
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
..
9pfs
acpi pci, pc, virtio: fixes, features 2018-09-24 18:49:11 +01:00
adc
alpha change get_image_size return type to int64_t 2018-10-02 19:08:49 +02:00
arm hw/arm/aspeed: Add an Aspeed machine class 2018-09-25 15:13:24 +01:00
audio es1370: fix ADC_FRAMEADR and ADC_FRAMECNT 2018-10-02 18:47:55 +02:00
block
bt
char virtio: do not take address of packed members 2018-10-02 19:09:13 +02:00
core change get_image_size return type to int64_t 2018-10-02 19:08:49 +02:00
cpu hw/cpu/a15mpcore: If CPU has EL2, enable it on the GIC and wire it up 2018-08-24 13:17:34 +01:00
cris
display qxl: support mono cursors with inverted colors 2018-09-27 08:10:07 +02:00
dma hw/dma/pl080: Remove hw_error() if DMA is enabled 2018-08-20 11:24:33 +01:00
gpio
hppa change get_image_size return type to int64_t 2018-10-02 19:08:49 +02:00
i2c aspeed/i2c: Fix receive done interrupt handling 2018-09-25 14:14:07 +01:00
i386 kvmclock: run KVM_KVMCLOCK_CTRL ioctl in vcpu thread 2018-10-02 19:09:13 +02:00
ide replay: replay BH for IDE trim operation 2018-10-02 19:09:13 +02:00
input ps2: prevent changing irq state on save and load 2018-10-02 18:47:55 +02:00
intc hw/intc/arm_gic: Drop GIC_BASE_IRQ macro 2018-09-25 15:13:24 +01:00
ipack
ipmi ipmi: Use proper struct reference for BT vmstate 2018-08-23 18:46:25 +02:00
isa i2c: pm_smbus: Add the ability to force block transfer enable 2018-08-23 18:46:25 +02:00
lm32
m68k
mem pc-dimm: assign and verify the "addr" property during pre_plug 2018-08-23 18:46:25 +02:00
microblaze
mips change get_image_size return type to int64_t 2018-10-02 19:08:49 +02:00
misc hw: edu: replace device name with macro 2018-10-02 19:09:12 +02:00
moxie change get_image_size return type to int64_t 2018-10-02 19:08:49 +02:00
net hw/net/pcnet-pci: Unify pcnet_ioport_read/write and pcnet_mmio_read/write 2018-09-25 15:13:24 +01:00
nios2
nvram hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct 2018-10-02 19:09:14 +02:00
openrisc
pci qmp, hmp: add PCI subsystem id and vendor id to PCI info 2018-09-25 14:48:44 +01:00
pci-bridge hw/pci: add PCI resource reserve capability to legacy PCI bridge 2018-09-07 17:05:18 -04:00
pci-host ppc patch queue 2018-09-25 2018-09-25 13:30:45 +01:00
pcmcia
ppc ppc patch queue 2018-09-25 2018-09-25 13:30:45 +01:00
rdma config: split PVRDMA from RDMA 2018-08-18 18:01:34 +03:00
riscv Error reporting & miscellaneous patches for 2018-09-24 2018-09-25 11:37:39 +01:00
s390x hw/s390x: Move virtio-ccw-blk code to a separate file 2018-08-28 17:37:01 +02:00
scsi hw/scsi/mptendian: Avoid taking address of fields in packed structs 2018-10-02 19:09:14 +02:00
sd sdhci: add i.MX SD Stable Clock bit 2018-08-20 11:24:32 +01:00
sh4
smbios
sparc sun4m: don't use legacy fw_cfg_init_mem() function 2018-08-20 19:18:31 +01:00
sparc64 sun4u: implement custom FWPathProvider 2018-09-14 09:18:11 +01:00
ssi aspeed/smc: fix some alignment issues 2018-09-25 15:13:24 +01:00
timer aspeed/timer: fix compile breakage with clang 3.4.2 2018-09-25 15:13:24 +01:00
tpm
tricore
unicore32
usb ohci: set effectively usb frame rate to 1kHz 2018-10-01 10:49:54 +02:00
vfio qemu-error: add {error, warn}_report_once_cond 2018-09-24 17:13:07 +02:00
virtio virtio: Return true from virtio_queue_empty if broken 2018-10-02 18:47:55 +02:00
watchdog qapi: Drop qapi_event_send_FOO()'s Error ** argument 2018-08-28 18:21:38 +02:00
xen
xenpv
xtensa
Makefile.objs