提交 f0fe91de 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NET]: Use BUILD_BUG_ON in net/core/flowi.c

Instead of ugly extern not-existing function.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 342709ef
......@@ -142,8 +142,6 @@ typedef u64 flow_compare_t;
typedef u32 flow_compare_t;
#endif
extern void flowi_is_missized(void);
/* I hear what you're saying, use memcmp. But memcmp cannot make
* important assumptions that we can here, such as alignment and
* constant size.
......@@ -153,8 +151,7 @@ static int flow_key_compare(struct flowi *key1, struct flowi *key2)
flow_compare_t *k1, *k1_lim, *k2;
const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t);
if (sizeof(struct flowi) % sizeof(flow_compare_t))
flowi_is_missized();
BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));
k1 = (flow_compare_t *) key1;
k1_lim = k1 + n_elem;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册