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/bluetooth | |
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/bluetooth')
-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 |
4 files changed, 9 insertions, 11 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; |