[INET]: Use BUILD_BUG_ON in inet_timewait_sock.c checks
Make the INET_TWDR_TWKILL_SLOTS vs sizeof(twdr->thread_slots) check nicer. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
1f9e636ea2
commit
95c9382a34
@@ -194,16 +194,14 @@ out:
|
|||||||
|
|
||||||
EXPORT_SYMBOL_GPL(inet_twdr_hangman);
|
EXPORT_SYMBOL_GPL(inet_twdr_hangman);
|
||||||
|
|
||||||
extern void twkill_slots_invalid(void);
|
|
||||||
|
|
||||||
void inet_twdr_twkill_work(struct work_struct *work)
|
void inet_twdr_twkill_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct inet_timewait_death_row *twdr =
|
struct inet_timewait_death_row *twdr =
|
||||||
container_of(work, struct inet_timewait_death_row, twkill_work);
|
container_of(work, struct inet_timewait_death_row, twkill_work);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((INET_TWDR_TWKILL_SLOTS - 1) > (sizeof(twdr->thread_slots) * 8))
|
BUILD_BUG_ON((INET_TWDR_TWKILL_SLOTS - 1) >
|
||||||
twkill_slots_invalid();
|
(sizeof(twdr->thread_slots) * 8));
|
||||||
|
|
||||||
while (twdr->thread_slots) {
|
while (twdr->thread_slots) {
|
||||||
spin_lock_bh(&twdr->death_lock);
|
spin_lock_bh(&twdr->death_lock);
|
||||||
|
Reference in New Issue
Block a user