public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf/x86/uncore: fix compilation warning in snb_uncore_imc_init_box()
@ 2014-03-11 23:53 Stephane Eranian
  2014-03-12  7:05 ` Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stephane Eranian @ 2014-03-11 23:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, sfr, hpa


This patch fixes a compilation problem (unused variable) with the
new SNB/IVB/HSW uncore IMC code.

In V2, we simplify the fix as suggested by Peter Zjilstra.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Stephane Eranian <eranian@google.com>
--

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 3e5b240..d614f6b 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -1722,15 +1722,16 @@ static struct attribute_group snb_uncore_imc_format_group = {
 static void snb_uncore_imc_init_box(struct intel_uncore_box *box)
 {
 	struct pci_dev *pdev = box->pci_dev;
-	u32 addr_lo, addr_hi;
+	int where = SNB_UNCORE_PCI_IMC_BAR_OFFSET;
+	u32 pci_dword;
 	resource_size_t addr;
 
-	pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET, &addr_lo);
-	addr = addr_lo;
+	pci_read_config_dword(pdev, where, &pci_dword);
+	addr = pci_dword;
 
 #ifdef CONFIG_PHYS_ADDR_T_64BIT
-	pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET+4, &addr_hi);
-	addr = ((resource_size_t)addr_hi << 32) | addr_lo;
+	  pci_read_config_dword(pdev, where + 4, &pci_dword);
+	  addr |= ((resource_size_t)pci_dword << 32);
 #endif
 
 	addr &= ~(PAGE_SIZE - 1);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-16 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 23:53 [PATCH v2] perf/x86/uncore: fix compilation warning in snb_uncore_imc_init_box() Stephane Eranian
2014-03-12  7:05 ` Peter Zijlstra
2014-03-12  9:23   ` Stephane Eranian
2014-03-12 10:10 ` [tip:perf/core] perf/x86/uncore: Fix " tip-bot for Stephane Eranian
2014-04-15 20:35 ` [PATCH v2] perf/x86/uncore: fix " Kirill A. Shutemov
2014-04-16 15:10   ` Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox