From patchwork Tue Nov 5 16:38: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: 21339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0A0EF25B39 for ; Tue, 5 Nov 2013 16:38:50 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf7763563veb.0 for ; Tue, 05 Nov 2013 08:38:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=q7So4WXcgI/4lYXTFG5V8YDBfaqZLbC7ClN0KX9vu9k=; b=VJUZdYcLjMnu2jHBmbtwIstp3dXFs9uc8faUFMIZzHBavhdJZjXeIv9bWQ2hKIFRnJ C7Svz05XXY1cxDXSUmBJi2UZ0/S/yag3Abnpg/Icuqy0I4Yw4NW011MY9+kJVKJlXejG 3ZhXzctZ2hJsxZFSqUK2H7FOS4YDySdk5dL2wjSzxsofNw2TrNXTLOvHM0oSv/1expkw oYYUXCSWResKQ24TuabzP0xRK0cGeKPfekTJ5XOo/CqY8pK50JIf9MtmW8IuwGr2Ttpx GmI4w5Y3sLsTBH4+gU2wn6SnUD59PkWWDo7os/vnFhREZsKZBDmYTIQueF3Hu9Lvr7AB VSVw== X-Gm-Message-State: ALoCoQkMzhM0gLFrmBXPwL+ZyWtKtFKtNiQBQDGudaQTy22w8DgpOUtAPA6QZSBOGaiJqGelBvz4 X-Received: by 10.236.135.211 with SMTP id u59mr5565346yhi.43.1383669529561; Tue, 05 Nov 2013 08:38:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.114 with SMTP id db18ls277251qeb.66.gmail; Tue, 05 Nov 2013 08:38:49 -0800 (PST) X-Received: by 10.52.37.137 with SMTP id y9mr49090vdj.84.1383669529440; Tue, 05 Nov 2013 08:38:49 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id j9si6755012vcg.10.2013.11.05.08.38.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 08:38:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id cz12so2651292veb.17 for ; Tue, 05 Nov 2013 08:38:49 -0800 (PST) X-Received: by 10.220.78.18 with SMTP id i18mr16333972vck.3.1383669529349; Tue, 05 Nov 2013 08:38:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp220011vcz; Tue, 5 Nov 2013 08:38:48 -0800 (PST) X-Received: by 10.180.106.227 with SMTP id gx3mr17397384wib.15.1383669528458; Tue, 05 Nov 2013 08:38:48 -0800 (PST) Received: from mnementh.archaic.org.uk (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]) by mx.google.com with ESMTPS id i13si2633999wiv.15.2013.11.05.08.38.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Nov 2013 08:38:48 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VdjeH-0006fn-Jz; Tue, 05 Nov 2013 16:38:37 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: Anthony Liguori , patches@linaro.org, Kevin Wolf , Stefan Hajnoczi , "Michael S. Tsirkin" , Richard Henderson Subject: [PATCH v2 7/9] bswap.h: Remove cpu_to_be32wu() Date: Tue, 5 Nov 2013 16:38:35 +0000 Message-Id: <1383669517-25598-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1383669517-25598-1-git-send-email-peter.maydell@linaro.org> References: <1383669517-25598-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Replace the legacy cpu_to_be32wu() with stl_be_p(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Michael S. Tsirkin --- 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 34ac625..8387443 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -599,8 +599,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 32aa0c6..991502e 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);