From patchwork Mon Oct 12 12:45:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11832449 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0116D109B for ; Mon, 12 Oct 2020 12:46:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C156E2076E for ; Mon, 12 Oct 2020 12:46:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J9B7H7Lr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C156E2076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.5927.15411 (Exim 4.92) (envelope-from ) id 1kRxCm-0002lW-K9; Mon, 12 Oct 2020 12:45:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 5927.15411; Mon, 12 Oct 2020 12:45:32 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCm-0002lN-Gi; Mon, 12 Oct 2020 12:45:32 +0000 Received: by outflank-mailman (input) for mailman id 5927; Mon, 12 Oct 2020 12:45:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCl-0002kr-Us for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:31 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id e9d0eca7-a567-4ea2-b67c-45a220f9f8aa; Mon, 12 Oct 2020 12:45:31 +0000 (UTC) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-8UvaL3I4NoeFMoWYH2yU_A-1; Mon, 12 Oct 2020 08:45:27 -0400 Received: by mail-wr1-f69.google.com with SMTP id q15so428804wrw.8 for ; Mon, 12 Oct 2020 05:45:27 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id d2sm14916896wrq.34.2020.10.12.05.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:25 -0700 (PDT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCl-0002kr-Us for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:31 +0000 X-Inumbo-ID: e9d0eca7-a567-4ea2-b67c-45a220f9f8aa Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id e9d0eca7-a567-4ea2-b67c-45a220f9f8aa; Mon, 12 Oct 2020 12:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602506731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=afTxi5eJGUK9TCxtbNIddaNUCDX7pFC3c3DvHTcAqpY=; b=J9B7H7LrBwwINvhmbA0l+GyBcrAWdBztzvrutX5qL9WpBHgXY5E3f50Ir4hPrPx7EdgzIn kR4x/qEi2is+WKZzD/VYzwSh6LAbviPzQByxNB409OF7AU6CG3ut1GZi4KTvieb3f//Fg0 EhfteZwtpEqiSFfOuc1YT8KEBIDC8Po= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-8UvaL3I4NoeFMoWYH2yU_A-1; Mon, 12 Oct 2020 08:45:27 -0400 X-MC-Unique: 8UvaL3I4NoeFMoWYH2yU_A-1 Received: by mail-wr1-f69.google.com with SMTP id q15so428804wrw.8 for ; Mon, 12 Oct 2020 05:45:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=afTxi5eJGUK9TCxtbNIddaNUCDX7pFC3c3DvHTcAqpY=; b=SGEzAkeueYgh1Hdl9rnkhIP18i9616ASlF36+VdljJtVtzRVAUQ3a/RPKQ5Su7hc5a +ujUMfIsvgEfW2HDoie/XHyMufSRNfkuFwWljUXgF3By+kbakcgePCW42VhrrpLIXgUN qHRy6Urn2i3HTQf9xPnD62CJlKzg6wMGLO82BXSJBlvsYl1Vj0eezxu2iaCp3Bcu8MN+ sezXXycjRWhAtXx3SHF+BwG4gago6CTIpXz90pelp7CELxjRXvMOWZdyhHU5q+ULUjFN prlh7pyoWv5FQo3aA+hvzCyXL4XLTrfA6l+DiW6sT+yRTo1uSChDP6PxfvEM/7epXnDl OL8w== X-Gm-Message-State: AOAM531xFIwIiXpe8mxKCUapgmDLG7TN69MqAvVW3a3P22eTG3XJD6Ny FzfJP92lltqux3nVk2OyyNaHvIsYX5DkJorPLtZ/9hNZT2ci9Egn8nREPnk8eHm7e/l3gOu+EWt H9wYRfd8fr1mQcN7xSMLJ3EBVBt8= X-Received: by 2002:adf:df03:: with SMTP id y3mr10299478wrl.70.1602506726315; Mon, 12 Oct 2020 05:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpp+5kB0ZYqB04uT+WIG2a4k9Wmj2oRtvHubS3HvdSiiZu7CRJnV3hLF0c9e7ixdPrjPJpoQ== X-Received: by 2002:adf:df03:: with SMTP id y3mr10299453wrl.70.1602506726102; Mon, 12 Oct 2020 05:45:26 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id d2sm14916896wrq.34.2020.10.12.05.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-ppc@nongnu.org, qemu-trivial@nongnu.org, Paul Durrant , Aurelien Jarno , qemu-arm@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eduardo Habkost , Jiaxun Yang , Yoshinori Sato , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= , David Gibson , Stefano Stabellini , Helge Deller , Anthony Perard , Richard Henderson , Aleksandar Markovic , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Marcel Apfelbaum , Mark Cave-Ayland , Paolo Bonzini , Huacai Chen Subject: [PATCH 3/5] hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h' Date: Mon, 12 Oct 2020 14:45:04 +0200 Message-Id: <20201012124506.3406909-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012124506.3406909-1-philmd@redhat.com> References: <20201012124506.3406909-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Philippe Mathieu-Daudé We already have a generic PCI_FUNC() macro in "hw/pci/pci.h" to extract the PCI function identifier, use it. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson --- hw/pci-host/uninorth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 1ed1072eeb5..c21de0ab805 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -65,7 +65,7 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr) if (slot == 32) { slot = -1; /* XXX: should this be 0? */ } - func = (reg >> 8) & 7; + func = PCI_FUNC(reg >> 8); /* ... and then convert them to x86 format */ /* config pointer */