summaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-10-12 06:53:00 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-12 14:00:22 -0400
commit5886d932e52acfbe12ea5aac8e7c3ad6f16364d1 (patch)
tree1d25d181f41482bfb655d1f39e2b7a69e3b831a5 /include/net/netlink.h
parente32cf9a386236523be005a66dbee7cdcb5148b4d (diff)
netlink: replace __NLA_ENSURE implementation
We already have BUILD_BUG_ON_ZERO() which I just hadn't found before, so we should use it here instead of open-coding another implementation thereof. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index f1db8e594847..4c1e99303b5a 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -311,7 +311,7 @@ struct nla_policy {
311#define NLA_POLICY_NESTED_ARRAY(maxattr, policy) \ 311#define NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
312 { .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr } 312 { .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr }
313 313
314#define __NLA_ENSURE(condition) (sizeof(char[1 - 2*!(condition)]) - 1) 314#define __NLA_ENSURE(condition) BUILD_BUG_ON_ZERO(!(condition))
315#define NLA_ENSURE_INT_TYPE(tp) \ 315#define NLA_ENSURE_INT_TYPE(tp) \
316 (__NLA_ENSURE(tp == NLA_S8 || tp == NLA_U8 || \ 316 (__NLA_ENSURE(tp == NLA_S8 || tp == NLA_U8 || \
317 tp == NLA_S16 || tp == NLA_U16 || \ 317 tp == NLA_S16 || tp == NLA_U16 || \