* [PATCH 5/7]: bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff.
@ 2008-09-23 2:12 David Miller
2008-09-23 4:59 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2008-09-23 2:12 UTC (permalink / raw)
To: netdev
bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/bluetooth/hci_bcsp.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 4d37bb3..7938062 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -352,14 +352,14 @@ static int bcsp_flush(struct hci_uart *hu)
/* Remove ack'ed packets */
static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
{
+ struct sk_buff *skb, *tmp;
unsigned long flags;
- struct sk_buff *skb;
int i, pkts_to_be_removed;
u8 seqno;
spin_lock_irqsave(&bcsp->unack.lock, flags);
- pkts_to_be_removed = bcsp->unack.qlen;
+ pkts_to_be_removed = skb_queue_len(&bcsp->unack);
seqno = bcsp->msgq_txseq;
while (pkts_to_be_removed) {
@@ -373,19 +373,19 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
BT_ERR("Peer acked invalid packet");
BT_DBG("Removing %u pkts out of %u, up to seqno %u",
- pkts_to_be_removed, bcsp->unack.qlen, (seqno - 1) & 0x07);
+ pkts_to_be_removed, skb_queue_len(&bcsp->unack),
+ (seqno - 1) & 0x07);
- for (i = 0, skb = ((struct sk_buff *) &bcsp->unack)->next; i < pkts_to_be_removed
- && skb != (struct sk_buff *) &bcsp->unack; i++) {
- struct sk_buff *nskb;
+ i = 0;
+ skb_queue_walk_safe(&bcsp->unack, skb, tmp) {
+ if (i++ >= pkts_to_be_removed)
+ break;
- nskb = skb->next;
__skb_unlink(skb, &bcsp->unack);
kfree_skb(skb);
- skb = nskb;
}
- if (bcsp->unack.qlen == 0)
+ if (skb_queue_empty(&bcsp->unack))
del_timer(&bcsp->tbcsp);
spin_unlock_irqrestore(&bcsp->unack.lock, flags);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/7]: bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff.
2008-09-23 2:12 [PATCH 5/7]: bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff David Miller
@ 2008-09-23 4:59 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2008-09-23 4:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Hi Dave,
> bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff.
the change looks good. However, I have no hardware to actually test it
with at the moment. And actually might not have for another month or so.
>From code review, Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-23 4:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 2:12 [PATCH 5/7]: bluetooth: hci_bcsp: Use SKB list interfaces instead of home-grown stuff David Miller
2008-09-23 4:59 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).