Re: [PATCH v2] perf/x86/uncore: fix compilation warning in snb_uncore_imc_init_box()
From: Stephane Eranian
Date: Wed Mar 12 2014 - 05:23:22 EST
On Wed, Mar 12, 2014 at 8:05 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Wed, Mar 12, 2014 at 12:53:30AM +0100, Stephane Eranian wrote:
>> #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
>
> Indent fail there; fixed it.
>
> FWIW; I thought of an even more horrible solution:
>
> resource_size_t addr;
> u32 *addr_ptr = &addr;
>
> pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET, &addr_ptr[0]);
> #ifdef ..
> pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET+4, &addr_ptr[1]);
> #endif
>
> :-)
Yeah, I really don't like that one. Always confused with little vs.
big endian or alignement!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/