b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 2/6] batman-adv: include build_bug.h for BUILD_BUG_ON define
Date: Sun, 19 Nov 2017 17:12:03 +0100	[thread overview]
Message-ID: <20171119161207.32588-3-sven@narfation.org> (raw)
In-Reply-To: <20171119161207.32588-1-sven@narfation.org>

commit bc6245e5efd7 ("bug: split BUILD_BUG stuff out into
<linux/build_bug.h>") added a new header for BUILD_BUG_ON. It should
therefore be included instead of linux/bug.h

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 compat-include/linux/build_bug.h   | 34 ++++++++++++++++++++++++++++++++++
 net/batman-adv/main.c              |  2 +-
 net/batman-adv/tp_meter.c          |  2 +-
 net/batman-adv/translation-table.c |  2 +-
 4 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 compat-include/linux/build_bug.h

diff --git a/compat-include/linux/build_bug.h b/compat-include/linux/build_bug.h
new file mode 100644
index 00000000..d1ebfa71
--- /dev/null
+++ b/compat-include/linux/build_bug.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (C) 2007-2017  B.A.T.M.A.N. contributors:
+ *
+ * Marek Lindner, Simon Wunderlich
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * License-Filename: LICENSES/preferred/GPL-2.0
+ *
+ * This file contains macros for maintaining compatibility with older versions
+ * of the Linux kernel.
+ */
+
+#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_
+#define _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
+#include_next <linux/build_bug.h>
+#else
+#include <linux/bug.h>
+#endif
+
+#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_ */
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 45f0f4ff..107b50e5 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -21,7 +21,7 @@
 #include "main.h"
 
 #include <linux/atomic.h>
-#include <linux/bug.h>
+#include <linux/build_bug.h>
 #include <linux/byteorder/generic.h>
 #include <linux/crc32c.h>
 #include <linux/errno.h>
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index 52e667ec..6b044717 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -22,7 +22,7 @@
 #include "main.h"
 
 #include <linux/atomic.h>
-#include <linux/bug.h>
+#include <linux/build_bug.h>
 #include <linux/byteorder/generic.h>
 #include <linux/cache.h>
 #include <linux/compiler.h>
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 66092c6b..db7a67ee 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -23,7 +23,7 @@
 
 #include <linux/atomic.h>
 #include <linux/bitops.h>
-#include <linux/bug.h>
+#include <linux/build_bug.h>
 #include <linux/byteorder/generic.h>
 #include <linux/cache.h>
 #include <linux/compiler.h>
-- 
2.11.0


  parent reply	other threads:[~2017-11-19 16:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 16:12 [B.A.T.M.A.N.] [PATCH 0/6] batman-adv: Include cleanup Sven Eckelmann
2017-11-19 16:12 ` [B.A.T.M.A.N.] [PATCH 1/6] batman-adv: include gfp.h for GFP_* defines Sven Eckelmann
2017-11-19 16:12 ` Sven Eckelmann [this message]
2017-11-19 16:12 ` [B.A.T.M.A.N.] [PATCH 3/6] batman-adv: Include net.h for net_ratelimited_function Sven Eckelmann
2017-11-19 16:12 ` [B.A.T.M.A.N.] [PATCH 4/6] batman-adv: include kobject.h for kobject_* functions Sven Eckelmann
2017-11-19 16:12 ` [B.A.T.M.A.N.] [PATCH 5/6] batman-adv: Remove unused sched.h include Sven Eckelmann
2017-11-19 16:12 ` [B.A.T.M.A.N.] [PATCH 6/6] batman-adv: compat: Map to linux/nl80211.h for Linux < 3.7 Sven Eckelmann
2017-12-06 10:42 ` [B.A.T.M.A.N.] [PATCH 0/6] batman-adv: Include cleanup Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171119161207.32588-3-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).