From patchwork Sun Aug 25 14:59:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 269700 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9A5152C00AC for ; Mon, 26 Aug 2013 01:00:57 +1000 (EST) Received: from localhost ([::1]:46390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDboF-0005Ze-1l for incoming@patchwork.ozlabs.org; Sun, 25 Aug 2013 11:00:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDbnD-0004oq-OK for qemu-devel@nongnu.org; Sun, 25 Aug 2013 10:59:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDbnC-0006f3-Sb for qemu-devel@nongnu.org; Sun, 25 Aug 2013 10:59:51 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:59464 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDbnC-0006cn-Dk for qemu-devel@nongnu.org; Sun, 25 Aug 2013 10:59:50 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VDbn0-0002tP-VB; Sun, 25 Aug 2013 15:59:39 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sun, 25 Aug 2013 15:59:35 +0100 Message-Id: <1377442777-11066-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377442777-11066-1-git-send-email-peter.maydell@linaro.org> References: <1377442777-11066-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Kevin Wolf , Stefan Hajnoczi , "Michael S. Tsirkin" , patches@linaro.org, Anthony Liguori , Richard Henderson Subject: [Qemu-devel] [PATCH 7/9] bswap.h: Remove cpu_to_be32wu() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Replace the legacy cpu_to_be32wu() with stl_be_p(). Signed-off-by: Peter Maydell Reviewed-by: Stefan Hajnoczi --- hw/block/cdrom.c | 6 +++--- hw/net/e1000.c | 3 +-- hw/pci/pcie_aer.c | 4 ++-- include/qemu/bswap.h | 5 ----- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/hw/block/cdrom.c b/hw/block/cdrom.c index 5c69f34..4e1019c 100644 --- a/hw/block/cdrom.c +++ b/hw/block/cdrom.c @@ -59,7 +59,7 @@ int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track) q += 3; } else { /* sector 0 */ - cpu_to_be32wu((uint32_t *)q, 0); + stl_be_p(q, 0); q += 4; } } @@ -73,7 +73,7 @@ int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track) lba_to_msf(q, nb_sectors); q += 3; } else { - cpu_to_be32wu((uint32_t *)q, nb_sectors); + stl_be_p(q, nb_sectors); q += 4; } len = q - buf; @@ -127,7 +127,7 @@ int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num) lba_to_msf(q, nb_sectors); q += 3; } else { - cpu_to_be32wu((uint32_t *)q, nb_sectors); + stl_be_p(q, nb_sectors); q += 4; } diff --git a/hw/net/e1000.c b/hw/net/e1000.c index b8e3ce9..06a2f6e 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -522,8 +522,7 @@ xmit_seg(E1000State *s) DBGOUT(TXSUM, "tcp %d tucss %d len %d\n", tp->tcp, css, len); if (tp->tcp) { sofar = frames * tp->mss; - cpu_to_be32wu((uint32_t *)(tp->data+css+4), // seq - ldl_be_p(tp->data+css+4)+sofar); + stl_be_p(tp->data+css+4, ldl_be_p(tp->data+css+4)+sofar); /* seq */ if (tp->paylen - sofar > tp->mss) tp->data[css + 13] &= ~9; // PSH, FIN } else // UDP diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c index ca762ab..723d88d 100644 --- a/hw/pci/pcie_aer.c +++ b/hw/pci/pcie_aer.c @@ -425,7 +425,7 @@ static void pcie_aer_update_log(PCIDevice *dev, const PCIEAERErr *err) /* 7.10.8 Header Log Register */ uint8_t *header_log = aer_cap + PCI_ERR_HEADER_LOG + i * sizeof err->header[0]; - cpu_to_be32wu((uint32_t*)header_log, err->header[i]); + stl_be_p(header_log, err->header[i]); } } else { assert(!(err->flags & PCIE_AER_ERR_TLP_PREFIX_PRESENT)); @@ -439,7 +439,7 @@ static void pcie_aer_update_log(PCIDevice *dev, const PCIEAERErr *err) /* 7.10.12 tlp prefix log register */ uint8_t *prefix_log = aer_cap + PCI_ERR_TLP_PREFIX_LOG + i * sizeof err->prefix[0]; - cpu_to_be32wu((uint32_t*)prefix_log, err->prefix[i]); + stl_be_p(prefix_log, err->prefix[i]); } errcap |= PCI_ERR_CAP_TLP; } else { diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 3bb6b71..b95cc73 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -412,11 +412,6 @@ static inline void stfq_be_p(void *ptr, float64 v) /* Legacy unaligned versions. Note that we never had a complete set. */ -static inline void cpu_to_be32wu(uint32_t *p, uint32_t v) -{ - stl_be_p(p, v); -} - static inline void cpu_to_be64wu(uint64_t *p, uint64_t v) { stq_be_p(p, v);