Skip to content

Commit f0fe91d

Browse files
xemulDavid S. Miller
authored andcommitted
[NET]: Use BUILD_BUG_ON in net/core/flowi.c
Instead of ugly extern not-existing function. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 342709e commit f0fe91d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎net/core/flow.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ typedef u64 flow_compare_t;
142142
typedef u32 flow_compare_t;
143143
#endif
144144

145-
extern void flowi_is_missized(void);
146-
147145
/* I hear what you're saying, use memcmp. But memcmp cannot make
148146
* important assumptions that we can here, such as alignment and
149147
* constant size.
@@ -153,8 +151,7 @@ static int flow_key_compare(struct flowi *key1, struct flowi *key2)
153151
flow_compare_t *k1, *k1_lim, *k2;
154152
const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t);
155153

156-
if (sizeof(struct flowi) % sizeof(flow_compare_t))
157-
flowi_is_missized();
154+
BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));
158155

159156
k1 = (flow_compare_t *) key1;
160157
k1_lim = k1 + n_elem;

0 commit comments

Comments
 (0)