Re: [PATCH] KVM: x86: Fix build breakage due to anonymous field initialization

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

 



On 2011-12-15 13:08, Peter Zijlstra wrote:
> On Thu, 2011-12-15 at 13:04 +0100, Jan Kiszka wrote:
>> Not all compilers accept anonymous field initialization, e.g. gcc
>> 4.5.1.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
>> ---
>>  arch/x86/kvm/pmu.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
>> index 061a03f..7aad544 100644
>> --- a/arch/x86/kvm/pmu.c
>> +++ b/arch/x86/kvm/pmu.c
>> @@ -170,10 +170,11 @@ static void reprogram_counter(struct kvm_pmc *pmc, u32 type,
>>  		.exclude_host = 1,
>>  		.exclude_user = exclude_user,
>>  		.exclude_kernel = exclude_kernel,
>> -		.sample_period = (-pmc->counter) & pmc_bitmask(pmc),
> +		{ .sample_period = ... },
> 
> Does that work?

Nope:

  CC [M]  arch/x86/kvm/pmu.o
/data/linux-kvm/arch/x86/kvm/pmu.c: In function ‘reprogram_counter’:
/data/linux-kvm/arch/x86/kvm/pmu.c:173:3: warning: braces around scalar initializer                                                                                                                  
/data/linux-kvm/arch/x86/kvm/pmu.c:173:3: warning: (near initialization for ‘attr.exclude_hv’)
/data/linux-kvm/arch/x86/kvm/pmu.c:173:3: error: field name not in record or union initializer
/data/linux-kvm/arch/x86/kvm/pmu.c:173:3: error: (near initialization for ‘attr.exclude_hv’)

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux