From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH 2/2] kvm tools: Protect from dup definitions in kernel header Date: Wed, 04 May 2011 00:27:34 +0400 Message-ID: <4DC06536.2070103@gmail.com> References: <1304437058-15651-1-git-send-email-levinsasha928@gmail.com> <1304437058-15651-2-git-send-email-levinsasha928@gmail.com> <20110503194915.GB23144@elte.hu> <1304452595.13143.3.camel@lappy> <20110503195907.GB24750@elte.hu> <4DC0613E.5000101@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Ingo Molnar , penberg@kernel.org, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org To: Sasha Levin Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:46953 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754723Ab1ECU1j (ORCPT ); Tue, 3 May 2011 16:27:39 -0400 Received: by eyx24 with SMTP id 24so149351eyx.19 for ; Tue, 03 May 2011 13:27:37 -0700 (PDT) In-Reply-To: <4DC0613E.5000101@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/04/2011 12:10 AM, Cyrill Gorcunov wrote: > On 05/03/2011 11:59 PM, Ingo Molnar wrote: > ... >>>> >>>> Hm, how can duplicate definitions happen? Only one place should define them - >>>> otherwise we might end up with incompatible definitions ... >>> >>> We has ALIGN defined in include/kvm/bios.h within our code. >> >> Well, but then the right solution would be to not define it there but remove >> it, and use the one we get from the kernel headers? >> >> Thanks, >> >> Ingo > > Yeah, the right way indeed to use kernel header. The former ALIGN was introduced by > me I fear when kvm tools were out of linux tree, ie quite early. Sasha mind to simply > drop the former ALIGN out? > Sasha, could you please also drop this lines from bios.h #ifndef ALIGN #define ALIGN(x, a) \ (((x) + ((a) - 1)) & ~((a) - 1)) #endif /* * note we use 16 bytes alignment which makes segment based * addressing easy to compute, dont change it otherwise you * may break local variables offsets in BIOS irq routines */ #define BIOS_NEXT_IRQ_ADDR(addr, size) \ ALIGN((addr + size + 1), 16) they are rudiments. -- Thanks, Cyrill