From patchwork Mon May 30 09:14:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 9140759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0129760777 for ; Mon, 30 May 2016 09:20:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E29AD200F4 for ; Mon, 30 May 2016 09:20:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D539528210; Mon, 30 May 2016 09:20:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C55D200F4 for ; Mon, 30 May 2016 09:20:52 +0000 (UTC) Received: from localhost ([::1]:58777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7JNT-0006RT-FC for patchwork-qemu-devel@patchwork.kernel.org; Mon, 30 May 2016 05:20:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7JLN-0004nE-T9 for qemu-devel@nongnu.org; Mon, 30 May 2016 05:18:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7JLJ-0008MP-Ok for qemu-devel@nongnu.org; Mon, 30 May 2016 05:18:41 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:38642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7JLJ-0008ME-IA for qemu-devel@nongnu.org; Mon, 30 May 2016 05:18:37 -0400 Received: by mail-wm0-x236.google.com with SMTP id n129so63550682wmn.1 for ; Mon, 30 May 2016 02:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravellosystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IfEKSUgdWwoANdJmqvld59uVIH+Jlc+jSWv2t3eiCfA=; b=MMEDozvxBarQXpoGRJIEbMNALsh5suZ4yVonLXgpqdFggCXofz91W45hCcZA/7LvQz uvBw8P6sh3t4jPsK8NCFPPTiYg9umk0YCtXxmjX0ssTPbZjNHKqRVCZgA9G2JbyKCBYe 9dc/PEzwU/cu4sSIS+rPeWwJOeD3T3hepGRwWlpAlUtaJXx30S5JUgeNdgNGQ1BN5GL2 xRCWFTYemMky86QFhyOLNyKkpxDC+CUEjQgjWt0Qun+bR6yHzDJs8GdqweN0iWTVVWKm gNEcXwG/YiS051BEu5s+upBEP8bdV5kyWuAIsAQvEsRiNt90YAhmu0WF/NpqZreN/14u nZXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IfEKSUgdWwoANdJmqvld59uVIH+Jlc+jSWv2t3eiCfA=; b=ChKqfVoC7RBbSc2/6tGropR+DskOCq3/7c3A2emKIQtcOvoTOvG+y1KEulT47InBuv L9xR/GKDqBLC+ssFG4CSLk0heSM8S6is5Rjdtb0E4+j380Hm4+txqgaKuwUiUgXGOEOs IQ345WlcFvckpy/4RK3FGBvBVjsoZ06ijkgLYt8rrgXQc6NxIOcMgNHOfGc2A3kbxAjc CsixzcKgllAjuBLMX2MXAe2SUltGxAKFDzY3yOIN2+gtLHkm+rdTJoZVI/uPSlaRJ5pS qXdJvbArgX9daT/TKV95Mg1VzqW9/Cf+jNiDCHelRdGVN3ktZiY0SyvSZbbCKch17F/2 Ae6w== X-Gm-Message-State: ALyK8tKg5cvSA9C4WGavDShbbLUBYS0pLGlY8ek7ffwrQ1fzXcdDTyQ1x8RdvpefDHk28by0 X-Received: by 10.194.108.197 with SMTP id hm5mr26121206wjb.167.1464599916960; Mon, 30 May 2016 02:18:36 -0700 (PDT) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id k127sm22753850wmf.21.2016.05.30.02.18.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 02:18:36 -0700 (PDT) From: Leonid Bloch To: qemu-devel@nongnu.org Date: Mon, 30 May 2016 12:14:26 +0300 Message-Id: <1464599682-14592-2-git-send-email-leonid.bloch@ravellosystems.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464599682-14592-1-git-send-email-leonid.bloch@ravellosystems.com> References: <1464599682-14592-1-git-send-email-leonid.bloch@ravellosystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::236 Subject: [Qemu-devel] [PATCH v6 01/17] pci: fix unaligned access in pci_xxx_quad() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , Jason Wang , Leonid Bloch , Shmulik Ladkani , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Fleytman Replace legacy cpu_to_le64w()/le64_to_cpup() calls with stq_le_p()/ldq_le_p(). Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch --- include/hw/pci/pci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index ef6ba51..ee238ad 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -468,13 +468,13 @@ pci_get_long(const uint8_t *config) static inline void pci_set_quad(uint8_t *config, uint64_t val) { - cpu_to_le64w((uint64_t *)config, val); + stq_le_p(config, val); } static inline uint64_t pci_get_quad(const uint8_t *config) { - return le64_to_cpup((const uint64_t *)config); + return ldq_le_p(config); } static inline void