Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0fe91de authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

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



Instead of ugly extern not-existing function.

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 342709ef
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -142,8 +142,6 @@ typedef u64 flow_compare_t;
typedef u32 flow_compare_t;
typedef u32 flow_compare_t;
#endif
#endif


extern void flowi_is_missized(void);

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


	if (sizeof(struct flowi) % sizeof(flow_compare_t))
	BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));
		flowi_is_missized();


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