From patchwork Wed Jan 20 09:09:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5011 Return-Path: Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=74.125.82.44; helo=mail-wm0-f44.google.com; envelope-from=sven@open-mesh.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Authentication-Results: open-mesh.org; dkim=pass reason="2048-bit key; unprotected key" header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=fqrDJLMq; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by open-mesh.org (Postfix) with ESMTPS id CF02F8116A for ; Wed, 20 Jan 2016 10:09:48 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id n5so18147266wmn.0 for ; Wed, 20 Jan 2016 01:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=2hkvrlIVb0GLyD2jsoqucJtSxJ1KTEj6dIOd4ctQVik=; b=fqrDJLMqBxl+f9VSoMfzrd3ms/obni/9QIjI7aRsTkZKUg83R9ju/7HCLtfXI+/Pt8 9mG8oMs2QiTWgwfd6ETlyXy0YawGRbCfQq0rn6hXsJjVEiBlRi39x2/rnLzV/IPGuAAB prVmaYb3cSFg55KSLW0gcOB2jV4al/IxLuO5i9ewPlqfdCTi41HxvriOjY1nyJ3DtJyp lnwRLCplTBHxN0wXA0BSQqHCcUy0EFPYSEi3EEVin8c+fHczdPhRHSPehZC1iDlHIrBW g5ahyPBzDKXLcBlofdKR6znr3+l/2ZMc9M/gIVegjwdz2D1kD9/uky0VK42uEbcjJHBq p0gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2hkvrlIVb0GLyD2jsoqucJtSxJ1KTEj6dIOd4ctQVik=; b=bb135i0Z+nhjUE304LdxbVYjvf+5LD4lxgXpI7EViEw855d4+ymP28DXUCs6MeqPd8 44/UbeE5hF9irFVLA0o3nbxoK4oxOCtgC6PoUaEQgFuwzUhnxRVGxXKVyZW0M6qIoGGO gP07l4G+LbLNukrUDb7Lwd8s4yyGepVZQqz46wiDK/xBMr27Yd5M03XUoNoTSb7W5IXW kkECocWq3zKMyV3IK1PBkHHSZ0yZLcWCAnek1Au8RnYxJ4ds+FQvgShkA7YtaNhHrwab CK88haIfF4hEmZbrLqaNZgPJcb3R/Ulz2itvrO3rjcDboGdP8KSYrrtNi3koB4JoLmS9 2iCQ== X-Gm-Message-State: AG10YOSZmYPpxUSDBIVL7BoeVnOltnnGwqmbI8yiXG6RVRvPqmXJVA6ANuDhSuSttLxJu2VX X-Received: by 10.28.146.8 with SMTP id u8mr2567914wmd.72.1453280987817; Wed, 20 Jan 2016 01:09:47 -0800 (PST) Received: from sven-desktop.home.narfation.org (x4d05afc7.dyn.telefonica.de. [77.5.175.199]) by smtp.gmail.com with ESMTPSA id u4sm32081134wjz.4.2016.01.20.01.09.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jan 2016 01:09:47 -0800 (PST) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 20 Jan 2016 10:09:41 +0100 Message-Id: <1453280981-3324-1-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.7.0.rc3 Cc: Sven Eckelmann Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Add compat code for BUILD_BUG_ON_NOT_POWER_OF_2 X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 09:09:49 -0000 Fixes: 2c2fe0ba9ea5 ("batman-adv: ELP - creating neighbor structures") Signed-off-by: Sven Eckelmann --- compat-include/linux/bug.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compat-include/linux/bug.h b/compat-include/linux/bug.h index 124fd28..0c46158 100644 --- a/compat-include/linux/bug.h +++ b/compat-include/linux/bug.h @@ -24,6 +24,19 @@ #include #include_next +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) + +#undef BUILD_BUG_ON_NOT_POWER_OF_2 +#ifdef __CHECKER__ +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) +#else +/* Force a compilation error if a constant expression is not a power of 2 */ +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ + BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) +#endif + +#endif /* < KERNEL_VERSION(2, 6, 33) */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) #undef BUILD_BUG_ON