From patchwork Tue May 3 15:37:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 750462 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p43FbvPi025139 for ; Tue, 3 May 2011 15:37:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606Ab1ECPhx (ORCPT ); Tue, 3 May 2011 11:37:53 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:55255 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725Ab1ECPhw (ORCPT ); Tue, 3 May 2011 11:37:52 -0400 Received: by mail-ww0-f44.google.com with SMTP id 36so221478wwa.1 for ; Tue, 03 May 2011 08:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=x+krvKNEdGdBf/v3EkbQ248ZciPjWhK6CoXjzBUcz1Q=; b=e3h53033Z9GEmK0BuLJ08o0QWjbFTssjXWnQ2unNyqrUPH/qTs9E5sACvMkRHFwCuw H4f4L5OMdzCtxt7abOi/Zw6wRDmiua5hbkWmiLxV2qeAJao9PTEVOgKvGGgTxzF7+oTu +Dwegz0qjLgHOEUKLzqtfBXGTJjeiksNBrb08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=eBIIb1GBox+Z99eGwZMKVzz1cF4j3s6iLgBBiCa5TmNBGKSCEgLbyNE4FqQRf/nO0h yKoRP20l9jXv1S2NS9hsc9K3ox0nmmJuZ/BKSfqfk766DeXLoVaazBJC06DdjuUysJCI m68AnSRGBhf2JrbCeDoME8agEgexucWVeQ5Y4= Received: by 10.227.150.90 with SMTP id x26mr1641343wbv.17.1304437072258; Tue, 03 May 2011 08:37:52 -0700 (PDT) Received: from localhost.localdomain (bzq-79-179-202-103.red.bezeqint.net [79.179.202.103]) by mx.google.com with ESMTPS id o23sm130765wbc.27.2011.05.03.08.37.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2011 08:37:51 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH 2/2] kvm tools: Protect from dup definitions in kernel header Date: Tue, 3 May 2011 18:37:38 +0300 Message-Id: <1304437058-15651-2-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 In-Reply-To: <1304437058-15651-1-git-send-email-levinsasha928@gmail.com> References: <1304437058-15651-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 03 May 2011 15:37:57 +0000 (UTC) The local kernel.h may redefine macros already defined otherwise, wrap it with #ifdef. Signed-off-by: Sasha Levin --- tools/kvm/include/linux/kernel.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/linux/kernel.h b/tools/kvm/include/linux/kernel.h index 8d83037..fccb624 100644 --- a/tools/kvm/include/linux/kernel.h +++ b/tools/kvm/include/linux/kernel.h @@ -1,10 +1,17 @@ #ifndef KVM__LINUX_KERNEL_H_ #define KVM__LINUX_KERNEL_H_ +#ifndef DIV_ROUND_UP #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#endif +#ifndef ALIGN #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) +#endif + +#ifndef __ALIGN_MASK #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) +#endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)