From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: x86: Fix build breakage due to anonymous field initialization Date: Thu, 15 Dec 2011 13:16:01 +0100 Message-ID: <4EE9E501.4010706@siemens.com> References: <1319993624-20247-1-git-send-email-gleb@redhat.com> <1319993624-20247-3-git-send-email-gleb@redhat.com> <4EE9E234.6050702@siemens.com> <1323950934.18942.37.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "avi@redhat.com" , "mtosatti@redhat.com" , Gleb Natapov , "kvm@vger.kernel.org" , "mingo@elte.hu" , "acme@ghostprotocols.net" To: Peter Zijlstra Return-path: Received: from thoth.sbs.de ([192.35.17.2]:18659 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089Ab1LOMQY (ORCPT ); Thu, 15 Dec 2011 07:16:24 -0500 In-Reply-To: <1323950934.18942.37.camel@twins> Sender: kvm-owner@vger.kernel.org List-ID: 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 >> --- >> 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 =3D 1, >> .exclude_user =3D exclude_user, >> .exclude_kernel =3D exclude_kernel, >> - .sample_period =3D (-pmc->counter) & pmc_bitmask(pmc), > + { .sample_period =3D ... }, >=20 > Does that work? Nope: CC [M] arch/x86/kvm/pmu.o /data/linux-kvm/arch/x86/kvm/pmu.c: In function =E2=80=98reprogram_coun= ter=E2=80=99: /data/linux-kvm/arch/x86/kvm/pmu.c:173:3: warning: braces around scalar= initializer = =20 /data/linux-kvm/arch/x86/kvm/pmu.c:173:3: warning: (near initialization= for =E2=80=98attr.exclude_hv=E2=80=99) /data/linux-kvm/arch/x86/kvm/pmu.c:173:3: error: field name not in reco= rd or union initializer /data/linux-kvm/arch/x86/kvm/pmu.c:173:3: error: (near initialization f= or =E2=80=98attr.exclude_hv=E2=80=99) Jan --=20 Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux