aboutsummaryrefslogtreecommitdiff
path: root/networking/tc.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-13 14:50:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-13 14:50:20 +0200
commitab3964db4e75e34f6f9347406c5fd2bced04f2dd (patch)
tree92113e4a008338ed8534858db97d3a5e09dc210b /networking/tc.c
parentf7ad927c2059ef9cd1cd6befeb43f26b92f6369f (diff)
downloadbusybox-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.tar.gz
libbb: introduce kernel-style BUILD_BUG_ON()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tc.c')
-rw-r--r--networking/tc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/networking/tc.c b/networking/tc.c
index 76e2e8359..6d1fef993 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -64,15 +64,14 @@ struct globals {
uint32_t filter_proto;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
-struct BUG_G_too_big {
- char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
-};
#define filter_ifindex (G.filter_ifindex)
#define filter_qdisc (G.filter_qdisc)
#define filter_parent (G.filter_parent)
#define filter_prio (G.filter_prio)
#define filter_proto (G.filter_proto)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { \
+ BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
+} while (0)
/* Allocates a buffer containing the name of a class id.
* The caller must free the returned memory. */