lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABPqkBT8tyS7ZZA_0nVzfeYZhQRSqdTpa2UTONYPkLs8B8LyOQ@mail.gmail.com>
Date:	Tue, 11 Mar 2014 12:24:36 +0100
From:	Stephane Eranian <eranian@...gle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	"H. Peter Anvin" <hpa@...or.com>, tglx <tglx@...uxtronic.de>
Subject: Re: [PATCH] perf/x86/uncore: fix compilation warning in snb_uncore_imc_init_box()

On Tue, Mar 11, 2014 at 12:13 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Mar 11, 2014 at 11:44:33AM +0100, Stephane Eranian wrote:
>>
>>
>> This patches fixes a compilation problem (unused variable) with the
>> new SNB/IVB/HSW uncore IMC code.
>>
>> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
>> Signed-off-by: Stephane Eranian <eranian@...gle.com>
>>
>> diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> index b262c61..3846a37 100644
>> --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> @@ -1722,15 +1722,19 @@ 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;
>> +     u32 addr_lo;
>>       resource_size_t addr;
>>
>>       pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET, &addr_lo);
>>       addr = addr_lo;
>>
>>  #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;
>> +     { u32 addr_hi;
>> +       int where = SNB_UNCORE_PCI_IMC_BAR_OFFSET + 4;
>> +
>> +       pci_read_config_dword(pdev, where, &addr_hi);
>> +       addr = ((resource_size_t)addr_hi << 32) | addr_lo;
>> +     }
>>  #endif
>
> How about something like:
>
> - u32 addr_lo, addr_hi;
> + u32 pci_dword;
>
>         pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET, &pci_dword);
>         addr = pci_dword;
>
> #ifdef ..
>         pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET + 4, &pci_dword);
>         addr |= ((u64)pci_dword) << 32;
> #endif
>
> That avoids the need for the ugly {} thing.
Okay, that's better.
I will repost then.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ