From patchwork Thu Nov 12 05:58:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 38203 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 CC962B7093 for ; Thu, 12 Nov 2009 17:09:55 +1100 (EST) Received: from localhost ([127.0.0.1]:44347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8SsS-00036r-23 for incoming@patchwork.ozlabs.org; Thu, 12 Nov 2009 01:09:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8Snn-0000X7-Cp for qemu-devel@nongnu.org; Thu, 12 Nov 2009 01:05:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8Sni-0000ST-Sv for qemu-devel@nongnu.org; Thu, 12 Nov 2009 01:05:02 -0500 Received: from [199.232.76.173] (port=53899 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8Sni-0000SG-Ml for qemu-devel@nongnu.org; Thu, 12 Nov 2009 01:04:58 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:53585) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8Snh-0001Dk-PC for qemu-devel@nongnu.org; Thu, 12 Nov 2009 01:04:58 -0500 Received: from nm.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with ESMTP id 1DF954A40B; Thu, 12 Nov 2009 15:04:54 +0900 (JST) Received: from yamahata by nm.local.valinux.co.jp with local (Exim 4.69) (envelope-from ) id 1N8Shk-0006cB-Sj; Thu, 12 Nov 2009 14:58:48 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org, mst@redhat.com Date: Thu, 12 Nov 2009 14:58:37 +0900 Message-Id: <1258005528-25383-10-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1258005528-25383-1-git-send-email-yamahata@valinux.co.jp> References: <1258005528-25383-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH 09/20] pci_host: remove unnecessary & 0xff. 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 This patch removes unnecessary & 0xff in pci_dev_find_by_addr(). Signed-off-by: Isaku Yamahata Acked-by: Michael S. Tsirkin --- hw/pci_host.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci_host.c b/hw/pci_host.c index cd2ceb7..672d173 100644 --- a/hw/pci_host.c +++ b/hw/pci_host.c @@ -42,8 +42,9 @@ do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0) /* the helper functio to get a PCIDeice* for a given pci address */ static inline PCIDevice *pci_dev_find_by_addr(PCIBus *bus, uint32_t addr) { - uint8_t bus_num = (addr >> 16) & 0xff; - uint8_t devfn = (addr >> 8) & 0xff; + uint8_t bus_num = addr >> 16; + uint8_t devfn = addr >> 8; + return pci_find_device(bus, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn)); }