diff options
author | Denys Vlasenko | 2011-02-10 06:28:09 +0100 |
---|---|---|
committer | Denys Vlasenko | 2011-02-10 06:28:09 +0100 |
commit | 77350aa93392d36dc419d3e11bda6bf9bed993ff (patch) | |
tree | 0f0a268b7ce9c520381b7cb2c4608f44452568ba /networking | |
parent | f13347130245f9fb86ecb3b9c217d3c558a717a9 (diff) | |
download | busybox-77350aa93392d36dc419d3e11bda6bf9bed993ff.zip busybox-77350aa93392d36dc419d3e11bda6bf9bed993ff.tar.gz |
tc: less ugly check for bad sizeof(G)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/tc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/networking/tc.c b/networking/tc.c index 2e2473a..9b32455 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -43,17 +43,15 @@ struct globals { __u32 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) - -void BUG_tc_globals_too_big(void); -#define INIT_G() do { \ - if (sizeof(G) > COMMON_BUFSIZE) \ - BUG_tc_globals_too_big(); \ -} while (0) +#define INIT_G() do { } while (0) /* Allocates a buffer containing the name of a class id. * The caller must free the returned memory. */ |