Re: [Qemu-devel] [PATCH] hw/usb/dev-network.c: Use ldl_le_p() and stl_le_p()

2016-06-13 Thread Gerd Hoffmann
On Fr, 2016-06-10 at 16:37 +0100, Peter Maydell wrote: > Use stl_le_p() and ldl_le_p() to read and write data from > buffers, rather than using pointer casts and cpu_to_le32() > for writes and le32_to_cpup() for reads. This: > * avoids lots of casts > * works even if the buffer isn't as aligned

Re: [Qemu-devel] [PATCH] hw/usb/dev-network.c: Use ldl_le_p() and stl_le_p()

2016-06-11 Thread Eric Blake
On 06/10/2016 09:37 AM, Peter Maydell wrote: > Use stl_le_p() and ldl_le_p() to read and write data from > buffers, rather than using pointer casts and cpu_to_le32() > for writes and le32_to_cpup() for reads. This: > * avoids lots of casts > * works even if the buffer isn't as aligned as the

[Qemu-devel] [PATCH] hw/usb/dev-network.c: Use ldl_le_p() and stl_le_p()

2016-06-10 Thread Peter Maydell
Use stl_le_p() and ldl_le_p() to read and write data from buffers, rather than using pointer casts and cpu_to_le32() for writes and le32_to_cpup() for reads. This: * avoids lots of casts * works even if the buffer isn't as aligned as the host would like * avoids using the *_to_cpup() functions