From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwy8q-0003yX-KM for qemu-devel@nongnu.org; Wed, 10 Jul 2013 13:25:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uwy8o-0003Jm-TI for qemu-devel@nongnu.org; Wed, 10 Jul 2013 13:25:24 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:61399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwy8o-0003JG-Kc for qemu-devel@nongnu.org; Wed, 10 Jul 2013 13:25:22 -0400 Received: by mail-la0-f44.google.com with SMTP id er20so6011922lab.3 for ; Wed, 10 Jul 2013 10:25:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1373476202-11277-2-git-send-email-chouteau@adacore.com> References: <1373476202-11277-1-git-send-email-chouteau@adacore.com> <1373476202-11277-2-git-send-email-chouteau@adacore.com> From: Peter Maydell Date: Wed, 10 Jul 2013 18:25:00 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 1/2] Add be16_to_cpupu function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de On 10 July 2013 18:10, Fabien Chouteau wrote: > --- a/include/qemu/bswap.h > +++ b/include/qemu/bswap.h > @@ -432,6 +432,11 @@ static inline uint32_t le32_to_cpupu(const uint32_t *p) > return ldl_le_p(p); > } > > +static inline uint16_t be16_to_cpupu(const uint16_t *p) > +{ > + return lduw_be_p(p); > +} > + So these functions are preceded by the comment: /* Legacy unaligned versions. Note that we never had a complete set. */ which suggests that we shouldn't be adding new ones. I think the correct answer is to use lduw_be_p() directly. (If so it's tempting to get rid of the legacy functions completely since the change would be pretty mechanical.) thanks -- PMM