From patchwork Tue Oct 19 09:06:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 68287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7721BB70D0 for ; Tue, 19 Oct 2010 20:16:29 +1100 (EST) Received: from localhost ([127.0.0.1]:57036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P88Iz-0007j3-GW for incoming@patchwork.ozlabs.org; Tue, 19 Oct 2010 05:16:25 -0400 Received: from [140.186.70.92] (port=55823 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P889q-0002aF-W7 for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:07:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P889i-0006NB-CI for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:06:58 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:32860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P889i-0006Mi-47 for qemu-devel@nongnu.org; Tue, 19 Oct 2010 05:06:50 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 76F17873C2; Tue, 19 Oct 2010 18:06:43 +0900 (JST) Received: (nullmailer pid 27254 invoked by uid 1000); Tue, 19 Oct 2010 09:06:41 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org Date: Tue, 19 Oct 2010 18:06:30 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: skandasa@cisco.com, adnan@khaleel.us, wexu2@cisco.com, mst@redhat.com, yamahata@valinux.co.jp, etmartin@cisco.com Subject: [Qemu-devel] [PATCH v5 03/14] pci: use pci_word_test_and_clear_mask() in pci_device_reset() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org use pci_clear_bit_word() in pci_device_reset() where appropriate. Signed-off-by: Isaku Yamahata --- Changes v4 -> v5 - use pci_word_test_and_clear_mask() --- hw/pci.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 300079f..409e2c0 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -139,9 +139,8 @@ static void pci_device_reset(PCIDevice *dev) dev->irq_state = 0; pci_update_irq_status(dev); /* Clear all writeable bits */ - pci_set_word(dev->config + PCI_COMMAND, - pci_get_word(dev->config + PCI_COMMAND) & - ~pci_get_word(dev->wmask + PCI_COMMAND)); + pci_word_test_and_clear_mask(dev->config + PCI_COMMAND, + pci_get_word(dev->wmask + PCI_COMMAND)); dev->config[PCI_CACHE_LINE_SIZE] = 0x0; dev->config[PCI_INTERRUPT_LINE] = 0x0; for (r = 0; r < PCI_NUM_REGIONS; ++r) {