[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/usb/dev-network.c: Use ldl_le_p() and stl_le
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] hw/usb/dev-network.c: Use ldl_le_p() and stl_le_p() |
Date: |
Mon, 13 Jun 2016 13:19:08 +0200 |
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 as the host would like
> * avoids using the *_to_cpup() functions which we want to get rid of
>
> Note that there may still be some places where a pointer from the
> guest is cast to a pointer to a host structure; these would also
> have to be changed for the device to work on a host CPU which
> enforces alignment restrictions.
>
Added to usb queue.
thanks,
Gerd