[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 1/6] x86/msi: remove some unused-but-set-variables


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Mon, 28 Aug 2023 13:56:49 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sSugDH+jgmJ2t21KwpZdRqjLqY8PIhOuQoVgJ7q4wiw=; b=eqEL7xDbTup4CV04/svym4epFIhstRM4dJDGQ4E3qXsnHfct18PpRajKMBaVKszqHn+mnZa6+TkS+pSC0CaT/708Zs3Yr+1ZfF84ioAe5LN1TDNuaOIMD1d8eGeaQBiyAEe1T1qgJbYZydmxbn/3RHZK257B6SbXYLy0LKRbPUke37IXeBHWCC62nfg6neqjaORLSymg2XTKMOaQxEFIw10s+i8HmhSo+hmUcx3ZP6U0xdIFSmiAHprwjaxX9Blc7cgFGYMKOqud0qaUIaeUVPHt4gRQYbkC5DDapnxaNeXjnpNmqd5PmSg89FljcPjKIPPftBY1E3mgavaEa8YChg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dL83EREyZlZA0NnDMtxy0VKkA223uxkJeHLSLaxHwN6J3h7y8jcbvmYx0g3jaivSd9qqNdSinrc2mq5pG8IF9A/T9sW698PcWUADof6Cl80wiIvI13Kftko5IigqCsKFuwSKV6eyTM7MJNthTAYC4L1tr7OYvIQvYEdk9wfpWAzdpZ5OyJMudvc3AQgV1rDXU1j/4usz+V2Amw/MlpjP3GVm2HZK7/FqyF1f1n5G5zKrfp6/PK9q+bYRDZpiR6MdD4o4y9jtalNJBOBm9DZZvoidnKsI7mhFs3j5gMRv1Nxg8z4UsaanR4aRSxkHIlpTc/lb+Pd1fCT2ioAoJfCVPg==
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 28 Aug 2023 18:00:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

These were left over after a previous pci_sbdf_t conversion.

Fixes: 0c38c61aad21 ("pci: switch pci_conf_write32 to use pci_sbdf_t")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
v3->v4:
* new patch: this change was split from
  ("xen/pci: convert pci_find_*cap* to pci_sbdf_t")

Found by building with EXTRA_CFLAGS_XEN_CORE="-Wunused-but-set-variable"

arch/x86/msi.c: In function ‘msi_set_mask_bit’:
arch/x86/msi.c:322:19: warning: variable ‘func’ set but not used 
[-Wunused-but-set-variable]
  322 |     u8 bus, slot, func;
      |                   ^~~~
arch/x86/msi.c:322:13: warning: variable ‘slot’ set but not used 
[-Wunused-but-set-variable]
  322 |     u8 bus, slot, func;
      |             ^~~~
arch/x86/msi.c:322:8: warning: variable ‘bus’ set but not used 
[-Wunused-but-set-variable]
  322 |     u8 bus, slot, func;
      |        ^~~
arch/x86/msi.c:321:9: warning: variable ‘seg’ set but not used 
[-Wunused-but-set-variable]
  321 |     u16 seg, control;
      |         ^~~
---
 xen/arch/x86/msi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d0bf63df1def..41b82f3e87cb 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -318,17 +318,12 @@ static bool msi_set_mask_bit(struct irq_desc *desc, bool 
host, bool guest)
 {
     struct msi_desc *entry = desc->msi_desc;
     struct pci_dev *pdev;
-    u16 seg, control;
-    u8 bus, slot, func;
+    uint16_t control;
     bool flag = host || guest, maskall;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
     pdev = entry->dev;
-    seg = pdev->seg;
-    bus = pdev->bus;
-    slot = PCI_SLOT(pdev->devfn);
-    func = PCI_FUNC(pdev->devfn);
     switch ( entry->msi_attrib.type )
     {
     case PCI_CAP_ID_MSI:
-- 
2.42.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.