diff options
author | David S. Miller <davem@davemloft.net> | 2005-07-08 17:57:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-08 17:57:23 -0400 |
commit | b03efcfb2180289718991bb984044ce6c5b7d1b0 (patch) | |
tree | f3b0c6c4eaf0991c28b7116a20994b48398eea57 /net | |
parent | a92b7b80579fe68fe229892815c750f6652eb6a9 (diff) |
[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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/cmtp/core.c | 6 | ||||
-rw-r--r-- | net/bluetooth/hidp/core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 7 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 2 | ||||
-rw-r--r-- | net/decnet/af_decnet.c | 10 | ||||
-rw-r--r-- | net/decnet/dn_nsp_out.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 11 | ||||
-rw-r--r-- | net/ipv4/tcp_timer.c | 5 | ||||
-rw-r--r-- | net/irda/irlap.c | 3 | ||||
-rw-r--r-- | net/irda/irlap_event.c | 14 | ||||
-rw-r--r-- | net/irda/irlap_frame.c | 8 | ||||
-rw-r--r-- | net/irda/irttp.c | 2 | ||||
-rw-r--r-- | net/llc/llc_c_ev.c | 2 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 2 | ||||
-rw-r--r-- | net/sched/sch_red.c | 2 | ||||
-rw-r--r-- | net/unix/af_unix.c | 4 |
17 files changed, 44 insertions, 50 deletions
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 2e341de3e763..901eff7ebe74 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
@@ -213,7 +213,7 @@ static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, in | |||
213 | return kernel_sendmsg(sock, &msg, &iv, 1, len); | 213 | return kernel_sendmsg(sock, &msg, &iv, 1, len); |
214 | } | 214 | } |
215 | 215 | ||
216 | static int cmtp_process_transmit(struct cmtp_session *session) | 216 | static void cmtp_process_transmit(struct cmtp_session *session) |
217 | { | 217 | { |
218 | struct sk_buff *skb, *nskb; | 218 | struct sk_buff *skb, *nskb; |
219 | unsigned char *hdr; | 219 | unsigned char *hdr; |
@@ -223,7 +223,7 @@ static int cmtp_process_transmit(struct cmtp_session *session) | |||
223 | 223 | ||
224 | if (!(nskb = alloc_skb(session->mtu, GFP_ATOMIC))) { | 224 | if (!(nskb = alloc_skb(session->mtu, GFP_ATOMIC))) { |
225 | BT_ERR("Can't allocate memory for new frame"); | 225 | BT_ERR("Can't allocate memory for new frame"); |
226 | return -ENOMEM; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||
229 | while ((skb = skb_dequeue(&session->transmit))) { | 229 | while ((skb = skb_dequeue(&session->transmit))) { |
@@ -275,8 +275,6 @@ static int cmtp_process_transmit(struct cmtp_session *session) | |||
275 | cmtp_send_frame(session, nskb->data, nskb->len); | 275 | cmtp_send_frame(session, nskb->data, nskb->len); |
276 | 276 | ||
277 | kfree_skb(nskb); | 277 | kfree_skb(nskb); |
278 | |||
279 | return skb_queue_len(&session->transmit); | ||
280 | } | 278 | } |
281 | 279 | ||
282 | static int cmtp_session(void *arg) | 280 | static int cmtp_session(void *arg) |
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index affbc55462e8..de8af5f42394 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -428,7 +428,7 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len) | |||
428 | return kernel_sendmsg(sock, &msg, &iv, 1, len); | 428 | return kernel_sendmsg(sock, &msg, &iv, 1, len); |
429 | } | 429 | } |
430 | 430 | ||
431 | static int hidp_process_transmit(struct hidp_session *session) | 431 | static void hidp_process_transmit(struct hidp_session *session) |
432 | { | 432 | { |
433 | struct sk_buff *skb; | 433 | struct sk_buff *skb; |
434 | 434 | ||
@@ -453,9 +453,6 @@ static int hidp_process_transmit(struct hidp_session *session) | |||
453 | hidp_set_timer(session); | 453 | hidp_set_timer(session); |
454 | kfree_skb(skb); | 454 | kfree_skb(skb); |
455 | } | 455 | } |
456 | |||
457 | return skb_queue_len(&session->ctrl_transmit) + | ||
458 | skb_queue_len(&session->intr_transmit); | ||
459 | } | 456 | } |
460 | 457 | ||
461 | static int hidp_session(void *arg) | 458 | static int hidp_session(void *arg) |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index f3f6355a2786..63a123c5c41b 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -590,8 +590,11 @@ static long rfcomm_sock_data_wait(struct sock *sk, long timeo) | |||
590 | for (;;) { | 590 | for (;;) { |
591 | set_current_state(TASK_INTERRUPTIBLE); | 591 | set_current_state(TASK_INTERRUPTIBLE); |
592 | 592 | ||
593 | if (skb_queue_len(&sk->sk_receive_queue) || sk->sk_err || (sk->sk_shutdown & RCV_SHUTDOWN) || | 593 | if (!skb_queue_empty(&sk->sk_receive_queue) || |
594 | signal_pending(current) || !timeo) | 594 | sk->sk_err || |
595 | (sk->sk_shutdown & RCV_SHUTDOWN) || | ||
596 | signal_pending(current) || | ||
597 | !timeo) | ||
595 | break; | 598 | break; |
596 | 599 | ||
597 | set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); | 600 | set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 6d689200bcf3..6304590fd36a 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -781,7 +781,7 @@ static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty) | |||
781 | 781 | ||
782 | BT_DBG("tty %p dev %p", tty, dev); | 782 | BT_DBG("tty %p dev %p", tty, dev); |
783 | 783 | ||
784 | if (skb_queue_len(&dlc->tx_queue)) | 784 | if (!skb_queue_empty(&dlc->tx_queue)) |
785 | return dlc->mtu; | 785 | return dlc->mtu; |
786 | 786 | ||
787 | return 0; | 787 | return 0; |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 29bb3cd21965..96a02800cd28 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
@@ -536,7 +536,7 @@ static void dn_keepalive(struct sock *sk) | |||
536 | * we are double checking that we are not sending too | 536 | * we are double checking that we are not sending too |
537 | * many of these keepalive frames. | 537 | * many of these keepalive frames. |
538 | */ | 538 | */ |
539 | if (skb_queue_len(&scp->other_xmit_queue) == 0) | 539 | if (skb_queue_empty(&scp->other_xmit_queue)) |
540 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); | 540 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); |
541 | } | 541 | } |
542 | 542 | ||
@@ -1191,7 +1191,7 @@ static unsigned int dn_poll(struct file *file, struct socket *sock, poll_table | |||
1191 | struct dn_scp *scp = DN_SK(sk); | 1191 | struct dn_scp *scp = DN_SK(sk); |
1192 | int mask = datagram_poll(file, sock, wait); | 1192 | int mask = datagram_poll(file, sock, wait); |
1193 | 1193 | ||
1194 | if (skb_queue_len(&scp->other_receive_queue)) | 1194 | if (!skb_queue_empty(&scp->other_receive_queue)) |
1195 | mask |= POLLRDBAND; | 1195 | mask |= POLLRDBAND; |
1196 | 1196 | ||
1197 | return mask; | 1197 | return mask; |
@@ -1214,7 +1214,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
1214 | 1214 | ||
1215 | case SIOCATMARK: | 1215 | case SIOCATMARK: |
1216 | lock_sock(sk); | 1216 | lock_sock(sk); |
1217 | val = (skb_queue_len(&scp->other_receive_queue) != 0); | 1217 | val = !skb_queue_empty(&scp->other_receive_queue); |
1218 | if (scp->state != DN_RUN) | 1218 | if (scp->state != DN_RUN) |
1219 | val = -ENOTCONN; | 1219 | val = -ENOTCONN; |
1220 | release_sock(sk); | 1220 | release_sock(sk); |
@@ -1630,7 +1630,7 @@ static int dn_data_ready(struct sock *sk, struct sk_buff_head *q, int flags, int | |||
1630 | int len = 0; | 1630 | int len = 0; |
1631 | 1631 | ||
1632 | if (flags & MSG_OOB) | 1632 | if (flags & MSG_OOB) |
1633 | return skb_queue_len(q) ? 1 : 0; | 1633 | return !skb_queue_empty(q) ? 1 : 0; |
1634 | 1634 | ||
1635 | while(skb != (struct sk_buff *)q) { | 1635 | while(skb != (struct sk_buff *)q) { |
1636 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 1636 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
@@ -1707,7 +1707,7 @@ static int dn_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1707 | if (sk->sk_err) | 1707 | if (sk->sk_err) |
1708 | goto out; | 1708 | goto out; |
1709 | 1709 | ||
1710 | if (skb_queue_len(&scp->other_receive_queue)) { | 1710 | if (!skb_queue_empty(&scp->other_receive_queue)) { |
1711 | if (!(flags & MSG_OOB)) { | 1711 | if (!(flags & MSG_OOB)) { |
1712 | msg->msg_flags |= MSG_OOB; | 1712 | msg->msg_flags |= MSG_OOB; |
1713 | if (!scp->other_report) { | 1713 | if (!scp->other_report) { |
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c index 42abbf3f524f..8cce1fdbda90 100644 --- a/net/decnet/dn_nsp_out.c +++ b/net/decnet/dn_nsp_out.c | |||
@@ -342,7 +342,8 @@ int dn_nsp_xmit_timeout(struct sock *sk) | |||
342 | 342 | ||
343 | dn_nsp_output(sk); | 343 | dn_nsp_output(sk); |
344 | 344 | ||
345 | if (skb_queue_len(&scp->data_xmit_queue) || skb_queue_len(&scp->other_xmit_queue)) | 345 | if (!skb_queue_empty(&scp->data_xmit_queue) || |
346 | !skb_queue_empty(&scp->other_xmit_queue)) | ||
346 | scp->persist = dn_nsp_persist(sk); | 347 | scp->persist = dn_nsp_persist(sk); |
347 | 348 | ||
348 | return 0; | 349 | return 0; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 29894c749163..ddb6ce4ecff2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1105,7 +1105,7 @@ static void tcp_prequeue_process(struct sock *sk) | |||
1105 | struct sk_buff *skb; | 1105 | struct sk_buff *skb; |
1106 | struct tcp_sock *tp = tcp_sk(sk); | 1106 | struct tcp_sock *tp = tcp_sk(sk); |
1107 | 1107 | ||
1108 | NET_ADD_STATS_USER(LINUX_MIB_TCPPREQUEUED, skb_queue_len(&tp->ucopy.prequeue)); | 1108 | NET_INC_STATS_USER(LINUX_MIB_TCPPREQUEUED); |
1109 | 1109 | ||
1110 | /* RX process wants to run with disabled BHs, though it is not | 1110 | /* RX process wants to run with disabled BHs, though it is not |
1111 | * necessary */ | 1111 | * necessary */ |
@@ -1369,7 +1369,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1369 | * is not empty. It is more elegant, but eats cycles, | 1369 | * is not empty. It is more elegant, but eats cycles, |
1370 | * unfortunately. | 1370 | * unfortunately. |
1371 | */ | 1371 | */ |
1372 | if (skb_queue_len(&tp->ucopy.prequeue)) | 1372 | if (!skb_queue_empty(&tp->ucopy.prequeue)) |
1373 | goto do_prequeue; | 1373 | goto do_prequeue; |
1374 | 1374 | ||
1375 | /* __ Set realtime policy in scheduler __ */ | 1375 | /* __ Set realtime policy in scheduler __ */ |
@@ -1394,7 +1394,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | if (tp->rcv_nxt == tp->copied_seq && | 1396 | if (tp->rcv_nxt == tp->copied_seq && |
1397 | skb_queue_len(&tp->ucopy.prequeue)) { | 1397 | !skb_queue_empty(&tp->ucopy.prequeue)) { |
1398 | do_prequeue: | 1398 | do_prequeue: |
1399 | tcp_prequeue_process(sk); | 1399 | tcp_prequeue_process(sk); |
1400 | 1400 | ||
@@ -1476,7 +1476,7 @@ skip_copy: | |||
1476 | } while (len > 0); | 1476 | } while (len > 0); |
1477 | 1477 | ||
1478 | if (user_recv) { | 1478 | if (user_recv) { |
1479 | if (skb_queue_len(&tp->ucopy.prequeue)) { | 1479 | if (!skb_queue_empty(&tp->ucopy.prequeue)) { |
1480 | int chunk; | 1480 | int chunk; |
1481 | 1481 | ||
1482 | tp->ucopy.len = copied > 0 ? len : 0; | 1482 | tp->ucopy.len = copied > 0 ? len : 0; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 8de2f1071c2b..53a8a5399f1e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2802,7 +2802,7 @@ static void tcp_sack_remove(struct tcp_sock *tp) | |||
2802 | int this_sack; | 2802 | int this_sack; |
2803 | 2803 | ||
2804 | /* Empty ofo queue, hence, all the SACKs are eaten. Clear. */ | 2804 | /* Empty ofo queue, hence, all the SACKs are eaten. Clear. */ |
2805 | if (skb_queue_len(&tp->out_of_order_queue) == 0) { | 2805 | if (skb_queue_empty(&tp->out_of_order_queue)) { |
2806 | tp->rx_opt.num_sacks = 0; | 2806 | tp->rx_opt.num_sacks = 0; |
2807 | tp->rx_opt.eff_sacks = tp->rx_opt.dsack; | 2807 | tp->rx_opt.eff_sacks = tp->rx_opt.dsack; |
2808 | return; | 2808 | return; |
@@ -2935,13 +2935,13 @@ queue_and_out: | |||
2935 | if(th->fin) | 2935 | if(th->fin) |
2936 | tcp_fin(skb, sk, th); | 2936 | tcp_fin(skb, sk, th); |
2937 | 2937 | ||
2938 | if (skb_queue_len(&tp->out_of_order_queue)) { | 2938 | if (!skb_queue_empty(&tp->out_of_order_queue)) { |
2939 | tcp_ofo_queue(sk); | 2939 | tcp_ofo_queue(sk); |
2940 | 2940 | ||
2941 | /* RFC2581. 4.2. SHOULD send immediate ACK, when | 2941 | /* RFC2581. 4.2. SHOULD send immediate ACK, when |
2942 | * gap in queue is filled. | 2942 | * gap in queue is filled. |
2943 | */ | 2943 | */ |
2944 | if (!skb_queue_len(&tp->out_of_order_queue)) | 2944 | if (skb_queue_empty(&tp->out_of_order_queue)) |
2945 | tp->ack.pingpong = 0; | 2945 | tp->ack.pingpong = 0; |
2946 | } | 2946 | } |
2947 | 2947 | ||
@@ -3249,9 +3249,8 @@ static int tcp_prune_queue(struct sock *sk) | |||
3249 | * This must not ever occur. */ | 3249 | * This must not ever occur. */ |
3250 | 3250 | ||
3251 | /* First, purge the out_of_order queue. */ | 3251 | /* First, purge the out_of_order queue. */ |
3252 | if (skb_queue_len(&tp->out_of_order_queue)) { | 3252 | if (!skb_queue_empty(&tp->out_of_order_queue)) { |
3253 | NET_ADD_STATS_BH(LINUX_MIB_OFOPRUNED, | 3253 | NET_INC_STATS_BH(LINUX_MIB_OFOPRUNED); |
3254 | skb_queue_len(&tp->out_of_order_queue)); | ||
3255 | __skb_queue_purge(&tp->out_of_order_queue); | 3254 | __skb_queue_purge(&tp->out_of_order_queue); |
3256 | 3255 | ||
3257 | /* Reset SACK state. A conforming SACK implementation will | 3256 | /* Reset SACK state. A conforming SACK implementation will |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index b127b4498565..0084227438c2 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -231,11 +231,10 @@ static void tcp_delack_timer(unsigned long data) | |||
231 | } | 231 | } |
232 | tp->ack.pending &= ~TCP_ACK_TIMER; | 232 | tp->ack.pending &= ~TCP_ACK_TIMER; |
233 | 233 | ||
234 | if (skb_queue_len(&tp->ucopy.prequeue)) { | 234 | if (!skb_queue_empty(&tp->ucopy.prequeue)) { |
235 | struct sk_buff *skb; | 235 | struct sk_buff *skb; |
236 | 236 | ||
237 | NET_ADD_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED, | 237 | NET_INC_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED); |
238 | skb_queue_len(&tp->ucopy.prequeue)); | ||
239 | 238 | ||
240 | while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) | 239 | while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) |
241 | sk->sk_backlog_rcv(sk, skb); | 240 | sk->sk_backlog_rcv(sk, skb); |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 046ad0750e48..7029618f5719 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -445,9 +445,8 @@ void irlap_disconnect_request(struct irlap_cb *self) | |||
445 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 445 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
446 | 446 | ||
447 | /* Don't disconnect until all data frames are successfully sent */ | 447 | /* Don't disconnect until all data frames are successfully sent */ |
448 | if (skb_queue_len(&self->txq) > 0) { | 448 | if (!skb_queue_empty(&self->txq)) { |
449 | self->disconnect_pending = TRUE; | 449 | self->disconnect_pending = TRUE; |
450 | |||
451 | return; | 450 | return; |
452 | } | 451 | } |
453 | 452 | ||
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 1cd89f5f3b75..a505b5457608 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
@@ -191,7 +191,7 @@ static void irlap_start_poll_timer(struct irlap_cb *self, int timeout) | |||
191 | * Send out the RR frames faster if our own transmit queue is empty, or | 191 | * Send out the RR frames faster if our own transmit queue is empty, or |
192 | * if the peer is busy. The effect is a much faster conversation | 192 | * if the peer is busy. The effect is a much faster conversation |
193 | */ | 193 | */ |
194 | if ((skb_queue_len(&self->txq) == 0) || (self->remote_busy)) { | 194 | if (skb_queue_empty(&self->txq) || self->remote_busy) { |
195 | if (self->fast_RR == TRUE) { | 195 | if (self->fast_RR == TRUE) { |
196 | /* | 196 | /* |
197 | * Assert that the fast poll timer has not reached the | 197 | * Assert that the fast poll timer has not reached the |
@@ -263,7 +263,7 @@ void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, | |||
263 | IRDA_DEBUG(2, "%s() : queue len = %d\n", __FUNCTION__, | 263 | IRDA_DEBUG(2, "%s() : queue len = %d\n", __FUNCTION__, |
264 | skb_queue_len(&self->txq)); | 264 | skb_queue_len(&self->txq)); |
265 | 265 | ||
266 | if (skb_queue_len(&self->txq)) { | 266 | if (!skb_queue_empty(&self->txq)) { |
267 | /* Prevent race conditions with irlap_data_request() */ | 267 | /* Prevent race conditions with irlap_data_request() */ |
268 | self->local_busy = TRUE; | 268 | self->local_busy = TRUE; |
269 | 269 | ||
@@ -1074,7 +1074,7 @@ static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event, | |||
1074 | #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ | 1074 | #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ |
1075 | /* Window has been adjusted for the max packet | 1075 | /* Window has been adjusted for the max packet |
1076 | * size, so much simpler... - Jean II */ | 1076 | * size, so much simpler... - Jean II */ |
1077 | nextfit = (skb_queue_len(&self->txq) > 0); | 1077 | nextfit = !skb_queue_empty(&self->txq); |
1078 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ | 1078 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ |
1079 | /* | 1079 | /* |
1080 | * Send data with poll bit cleared only if window > 1 | 1080 | * Send data with poll bit cleared only if window > 1 |
@@ -1814,7 +1814,7 @@ static int irlap_state_xmit_s(struct irlap_cb *self, IRLAP_EVENT event, | |||
1814 | #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ | 1814 | #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ |
1815 | /* Window has been adjusted for the max packet | 1815 | /* Window has been adjusted for the max packet |
1816 | * size, so much simpler... - Jean II */ | 1816 | * size, so much simpler... - Jean II */ |
1817 | nextfit = (skb_queue_len(&self->txq) > 0); | 1817 | nextfit = !skb_queue_empty(&self->txq); |
1818 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ | 1818 | #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ |
1819 | /* | 1819 | /* |
1820 | * Send data with final bit cleared only if window > 1 | 1820 | * Send data with final bit cleared only if window > 1 |
@@ -1937,7 +1937,7 @@ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, | |||
1937 | irlap_data_indication(self, skb, FALSE); | 1937 | irlap_data_indication(self, skb, FALSE); |
1938 | 1938 | ||
1939 | /* Any pending data requests? */ | 1939 | /* Any pending data requests? */ |
1940 | if ((skb_queue_len(&self->txq) > 0) && | 1940 | if (!skb_queue_empty(&self->txq) && |
1941 | (self->window > 0)) | 1941 | (self->window > 0)) |
1942 | { | 1942 | { |
1943 | self->ack_required = TRUE; | 1943 | self->ack_required = TRUE; |
@@ -2038,7 +2038,7 @@ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, | |||
2038 | /* | 2038 | /* |
2039 | * Any pending data requests? | 2039 | * Any pending data requests? |
2040 | */ | 2040 | */ |
2041 | if ((skb_queue_len(&self->txq) > 0) && | 2041 | if (!skb_queue_empty(&self->txq) && |
2042 | (self->window > 0) && !self->remote_busy) | 2042 | (self->window > 0) && !self->remote_busy) |
2043 | { | 2043 | { |
2044 | irlap_data_indication(self, skb, TRUE); | 2044 | irlap_data_indication(self, skb, TRUE); |
@@ -2069,7 +2069,7 @@ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, | |||
2069 | */ | 2069 | */ |
2070 | nr_status = irlap_validate_nr_received(self, info->nr); | 2070 | nr_status = irlap_validate_nr_received(self, info->nr); |
2071 | if (nr_status == NR_EXPECTED) { | 2071 | if (nr_status == NR_EXPECTED) { |
2072 | if ((skb_queue_len( &self->txq) > 0) && | 2072 | if (!skb_queue_empty(&self->txq) && |
2073 | (self->window > 0)) { | 2073 | (self->window > 0)) { |
2074 | self->remote_busy = FALSE; | 2074 | self->remote_busy = FALSE; |
2075 | 2075 | ||
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 040abe714aa3..6dafbb43b529 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
@@ -1018,11 +1018,10 @@ void irlap_resend_rejected_frames(struct irlap_cb *self, int command) | |||
1018 | /* | 1018 | /* |
1019 | * We can now fill the window with additional data frames | 1019 | * We can now fill the window with additional data frames |
1020 | */ | 1020 | */ |
1021 | while (skb_queue_len( &self->txq) > 0) { | 1021 | while (!skb_queue_empty(&self->txq)) { |
1022 | 1022 | ||
1023 | IRDA_DEBUG(0, "%s(), sending additional frames!\n", __FUNCTION__); | 1023 | IRDA_DEBUG(0, "%s(), sending additional frames!\n", __FUNCTION__); |
1024 | if ((skb_queue_len( &self->txq) > 0) && | 1024 | if (self->window > 0) { |
1025 | (self->window > 0)) { | ||
1026 | skb = skb_dequeue( &self->txq); | 1025 | skb = skb_dequeue( &self->txq); |
1027 | IRDA_ASSERT(skb != NULL, return;); | 1026 | IRDA_ASSERT(skb != NULL, return;); |
1028 | 1027 | ||
@@ -1031,8 +1030,7 @@ void irlap_resend_rejected_frames(struct irlap_cb *self, int command) | |||
1031 | * bit cleared | 1030 | * bit cleared |
1032 | */ | 1031 | */ |
1033 | if ((self->window > 1) && | 1032 | if ((self->window > 1) && |
1034 | skb_queue_len(&self->txq) > 0) | 1033 | !skb_queue_empty(&self->txq)) { |
1035 | { | ||
1036 | irlap_send_data_primary(self, skb); | 1034 | irlap_send_data_primary(self, skb); |
1037 | } else { | 1035 | } else { |
1038 | irlap_send_data_primary_poll(self, skb); | 1036 | irlap_send_data_primary_poll(self, skb); |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index d091ccf773b3..6602d901f8b1 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -1513,7 +1513,7 @@ int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata, | |||
1513 | /* | 1513 | /* |
1514 | * Check if there is still data segments in the transmit queue | 1514 | * Check if there is still data segments in the transmit queue |
1515 | */ | 1515 | */ |
1516 | if (skb_queue_len(&self->tx_queue) > 0) { | 1516 | if (!skb_queue_empty(&self->tx_queue)) { |
1517 | if (priority == P_HIGH) { | 1517 | if (priority == P_HIGH) { |
1518 | /* | 1518 | /* |
1519 | * No need to send the queued data, if we are | 1519 | * No need to send the queued data, if we are |
diff --git a/net/llc/llc_c_ev.c b/net/llc/llc_c_ev.c index cd130c3b72bc..d5bdb53a348f 100644 --- a/net/llc/llc_c_ev.c +++ b/net/llc/llc_c_ev.c | |||
@@ -84,7 +84,7 @@ static u16 llc_util_nr_inside_tx_window(struct sock *sk, u8 nr) | |||
84 | if (llc->dev->flags & IFF_LOOPBACK) | 84 | if (llc->dev->flags & IFF_LOOPBACK) |
85 | goto out; | 85 | goto out; |
86 | rc = 1; | 86 | rc = 1; |
87 | if (!skb_queue_len(&llc->pdu_unack_q)) | 87 | if (skb_queue_empty(&llc->pdu_unack_q)) |
88 | goto out; | 88 | goto out; |
89 | skb = skb_peek(&llc->pdu_unack_q); | 89 | skb = skb_peek(&llc->pdu_unack_q); |
90 | pdu = llc_pdu_sn_hdr(skb); | 90 | pdu = llc_pdu_sn_hdr(skb); |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index fc456a7aaec3..3405fdf41b93 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -858,7 +858,7 @@ static inline void netlink_rcv_wake(struct sock *sk) | |||
858 | { | 858 | { |
859 | struct netlink_sock *nlk = nlk_sk(sk); | 859 | struct netlink_sock *nlk = nlk_sk(sk); |
860 | 860 | ||
861 | if (!skb_queue_len(&sk->sk_receive_queue)) | 861 | if (skb_queue_empty(&sk->sk_receive_queue)) |
862 | clear_bit(0, &nlk->state); | 862 | clear_bit(0, &nlk->state); |
863 | if (!test_bit(0, &nlk->state)) | 863 | if (!test_bit(0, &nlk->state)) |
864 | wake_up_interruptible(&nlk->wait); | 864 | wake_up_interruptible(&nlk->wait); |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 664d0e47374f..7845d045eec4 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -385,7 +385,7 @@ static int red_change(struct Qdisc *sch, struct rtattr *opt) | |||
385 | memcpy(q->Stab, RTA_DATA(tb[TCA_RED_STAB-1]), 256); | 385 | memcpy(q->Stab, RTA_DATA(tb[TCA_RED_STAB-1]), 256); |
386 | 386 | ||
387 | q->qcount = -1; | 387 | q->qcount = -1; |
388 | if (skb_queue_len(&sch->q) == 0) | 388 | if (skb_queue_empty(&sch->q)) |
389 | PSCHED_SET_PASTPERFECT(q->qidlestart); | 389 | PSCHED_SET_PASTPERFECT(q->qidlestart); |
390 | sch_tree_unlock(sch); | 390 | sch_tree_unlock(sch); |
391 | return 0; | 391 | return 0; |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index c420eba4876b..d403e34088ad 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -302,7 +302,7 @@ static void unix_write_space(struct sock *sk) | |||
302 | * may receive messages only from that peer. */ | 302 | * may receive messages only from that peer. */ |
303 | static void unix_dgram_disconnected(struct sock *sk, struct sock *other) | 303 | static void unix_dgram_disconnected(struct sock *sk, struct sock *other) |
304 | { | 304 | { |
305 | if (skb_queue_len(&sk->sk_receive_queue)) { | 305 | if (!skb_queue_empty(&sk->sk_receive_queue)) { |
306 | skb_queue_purge(&sk->sk_receive_queue); | 306 | skb_queue_purge(&sk->sk_receive_queue); |
307 | wake_up_interruptible_all(&unix_sk(sk)->peer_wait); | 307 | wake_up_interruptible_all(&unix_sk(sk)->peer_wait); |
308 | 308 | ||
@@ -1619,7 +1619,7 @@ static long unix_stream_data_wait(struct sock * sk, long timeo) | |||
1619 | for (;;) { | 1619 | for (;;) { |
1620 | prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); | 1620 | prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); |
1621 | 1621 | ||
1622 | if (skb_queue_len(&sk->sk_receive_queue) || | 1622 | if (!skb_queue_empty(&sk->sk_receive_queue) || |
1623 | sk->sk_err || | 1623 | sk->sk_err || |
1624 | (sk->sk_shutdown & RCV_SHUTDOWN) || | 1624 | (sk->sk_shutdown & RCV_SHUTDOWN) || |
1625 | signal_pending(current) || | 1625 | signal_pending(current) || |