From patchwork Fri Nov 13 04:29:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 38321 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 43C2C1007D2 for ; Fri, 13 Nov 2009 15:47:01 +1100 (EST) Received: from localhost ([127.0.0.1]:42342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8o3m-0004KR-Em for incoming@patchwork.ozlabs.org; Thu, 12 Nov 2009 23:46:58 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8ntR-0000Jm-JC for qemu-devel@nongnu.org; Thu, 12 Nov 2009 23:36:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8ntL-0000FQ-SQ for qemu-devel@nongnu.org; Thu, 12 Nov 2009 23:36:15 -0500 Received: from [199.232.76.173] (port=50455 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8ntL-0000FJ-84 for qemu-devel@nongnu.org; Thu, 12 Nov 2009 23:36:11 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:35523) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8ntK-0002e8-LJ for qemu-devel@nongnu.org; Thu, 12 Nov 2009 23:36:10 -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 408D74A417; Fri, 13 Nov 2009 13:36:02 +0900 (JST) Received: from yamahata by nm.local.valinux.co.jp with local (Exim 4.69) (envelope-from ) id 1N8nnI-0000wY-Su; Fri, 13 Nov 2009 13:29:56 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org, mst@redhat.com Date: Fri, 13 Nov 2009 13:29:45 +0900 Message-Id: <1258086596-3584-10-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1258086596-3584-1-git-send-email-yamahata@valinux.co.jp> References: <1258086596-3584-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 V2 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 45ddcd1..eeb8dee 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)); }