[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] nbd: Don't use *_to_cpup() functions
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] nbd: Don't use *_to_cpup() functions |
Date: |
Fri, 10 Jun 2016 09:04:37 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 06/10/2016 09:00 AM, Peter Maydell wrote:
> The *_to_cpup() functions are not very useful, as they simply do
> a pointer dereference and then a *_to_cpu(). Instead use either:
> * ld*_*_p(), if the data is at an address that might not be
> correctly aligned for the load
> * a local dereference and *_to_cpu(), if the pointer is
> the correct type and known to be correctly aligned
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> The motivation is to be able to drop *_to_cpup() entirely;
> we don't have many places that use it.
> ---
> nbd/client.c | 8 ++++----
> nbd/server.c | 10 +++++-----
> qemu-nbd.c | 4 ++--
> 3 files changed, 11 insertions(+), 11 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature