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

Commit b03efcfb authored by David S. Miller's avatar David S. Miller
Browse files

[NET]: Transform skb_queue_len() binary tests into skb_queue_empty()



This is part of the grand scheme to eliminate the qlen
member of skb_queue_head, and subsequently remove the
'list' member of sk_buff.

Most users of skb_queue_len() want to know if the queue is
empty or not, and that's trivially done with skb_queue_empty()
which doesn't use the skb_queue_head->qlen member and instead
uses the queue list emptyness as the test.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a92b7b80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ static unsigned int hci_vhci_chr_poll(struct file *file, poll_table * wait)

	poll_wait(file, &hci_vhci->read_wait, wait);
 
	if (skb_queue_len(&hci_vhci->readq))
	if (!skb_queue_empty(&hci_vhci->readq))
		return POLLIN | POLLRDNORM;

	return POLLOUT | POLLWRNORM;
+2 −1
Original line number Diff line number Diff line
@@ -279,7 +279,8 @@ BChannel_proc_xmt(struct BCState *bcs)
	if (test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags))
		st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
	if (!test_bit(BC_FLG_ACTIV, &bcs->Flag)) {
		if (!test_bit(BC_FLG_BUSY, &bcs->Flag) && (!skb_queue_len(&bcs->squeue))) {
		if (!test_bit(BC_FLG_BUSY, &bcs->Flag) &&
		    skb_queue_empty(&bcs->squeue)) {
			st->l2.l2l1(st, PH_DEACTIVATE | CONFIRM, NULL);
		}
	}
+9 −8
Original line number Diff line number Diff line
@@ -108,7 +108,8 @@ static int l2addrsize(struct Layer2 *l2);
static void
set_peer_busy(struct Layer2 *l2) {
	test_and_set_bit(FLG_PEER_BUSY, &l2->flag);
	if (skb_queue_len(&l2->i_queue) || skb_queue_len(&l2->ui_queue))
	if (!skb_queue_empty(&l2->i_queue) ||
	    !skb_queue_empty(&l2->ui_queue))
		test_and_set_bit(FLG_L2BLOCK, &l2->flag);
}

@@ -754,7 +755,7 @@ l2_restart_multi(struct FsmInst *fi, int event, void *arg)
		st->l2.l2l3(st, DL_ESTABLISH | INDICATION, NULL);

	if ((ST_L2_7==state) || (ST_L2_8 == state))
		if (skb_queue_len(&st->l2.i_queue) && cansend(st))
		if (!skb_queue_empty(&st->l2.i_queue) && cansend(st))
			st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
}

@@ -810,7 +811,7 @@ l2_connected(struct FsmInst *fi, int event, void *arg)
	if (pr != -1)
		st->l2.l2l3(st, pr, NULL);

	if (skb_queue_len(&st->l2.i_queue) && cansend(st))
	if (!skb_queue_empty(&st->l2.i_queue) && cansend(st))
		st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
}

@@ -1014,7 +1015,7 @@ l2_st7_got_super(struct FsmInst *fi, int event, void *arg)
			if(typ != RR) FsmDelTimer(&st->l2.t203, 9);
			restart_t200(st, 12);
		}
		if (skb_queue_len(&st->l2.i_queue) && (typ == RR))
		if (!skb_queue_empty(&st->l2.i_queue) && (typ == RR))
			st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
	} else
		nrerrorrecovery(fi);
@@ -1120,7 +1121,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg)
		return;
	}

	if (skb_queue_len(&st->l2.i_queue) && (fi->state == ST_L2_7))
	if (!skb_queue_empty(&st->l2.i_queue) && (fi->state == ST_L2_7))
		st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
	if (test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag))
		enquiry_cr(st, RR, RSP, 0);
@@ -1138,7 +1139,7 @@ l2_got_tei(struct FsmInst *fi, int event, void *arg)
		test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
	} else
		FsmChangeState(fi, ST_L2_4);
	if (skb_queue_len(&st->l2.ui_queue))
	if (!skb_queue_empty(&st->l2.ui_queue))
		tx_ui(st);
}

@@ -1301,7 +1302,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
		FsmDelTimer(&st->l2.t203, 13);
		FsmAddTimer(&st->l2.t200, st->l2.T200, EV_L2_T200, NULL, 11);
	}
	if (skb_queue_len(&l2->i_queue) && cansend(st))
	if (!skb_queue_empty(&l2->i_queue) && cansend(st))
		st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
}

@@ -1347,7 +1348,7 @@ l2_st8_got_super(struct FsmInst *fi, int event, void *arg)
			}
			invoke_retransmission(st, nr);
			FsmChangeState(fi, ST_L2_7);
			if (skb_queue_len(&l2->i_queue) && cansend(st))
			if (!skb_queue_empty(&l2->i_queue) && cansend(st))
				st->l2.l2l1(st, PH_PULL | REQUEST, NULL);
		} else
			nrerrorrecovery(fi);
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ release_l3_process(struct l3_process *p)
				!test_bit(FLG_PTP, &p->st->l2.flag)) {
				if (p->debug)
					l3_debug(p->st, "release_l3_process: last process");
				if (!skb_queue_len(&p->st->l3.squeue)) {
				if (skb_queue_empty(&p->st->l3.squeue)) {
					if (p->debug)
						l3_debug(p->st, "release_l3_process: release link");
					if (p->st->protocol != ISDN_PTYPE_NI1)
+2 −2
Original line number Diff line number Diff line
@@ -1223,7 +1223,7 @@ isdn_tty_write(struct tty_struct *tty, const u_char * buf, int count)
		total += c;
	}
	atomic_dec(&info->xmit_lock);
	if ((info->xmit_count) || (skb_queue_len(&info->xmit_queue))) {
	if ((info->xmit_count) || !skb_queue_empty(&info->xmit_queue)) {
		if (m->mdmreg[REG_DXMT] & BIT_DXMT) {
			isdn_tty_senddown(info);
			isdn_tty_tint(info);
@@ -1284,7 +1284,7 @@ isdn_tty_flush_chars(struct tty_struct *tty)

	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_chars"))
		return;
	if ((info->xmit_count) || (skb_queue_len(&info->xmit_queue)))
	if ((info->xmit_count) || !skb_queue_empty(&info->xmit_queue))
		isdn_timer_ctrl(ISDN_TIMER_MODEMXMIT, 1);
}

Loading