Skip to content

Commit

Permalink
econet: Use SKB queue and list helpers instead of doing it by-hand.
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 28, 2009
1 parent bec571e commit de10334
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions net/econet/af_econet.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,15 +901,10 @@ static void aun_tx_ack(unsigned long seq, int result)
struct ec_cb *eb;

spin_lock_irqsave(&aun_queue_lock, flags);
skb = skb_peek(&aun_queue);
while (skb && skb != (struct sk_buff *)&aun_queue)
{
struct sk_buff *newskb = skb->next;
skb_queue_walk(&aun_queue, skb) {
eb = (struct ec_cb *)&skb->cb;
if (eb->seq == seq)
goto foundit;

skb = newskb;
}
spin_unlock_irqrestore(&aun_queue_lock, flags);
printk(KERN_DEBUG "AUN: unknown sequence %ld\n", seq);
Expand Down Expand Up @@ -982,23 +977,18 @@ static void aun_data_available(struct sock *sk, int slen)

static void ab_cleanup(unsigned long h)
{
struct sk_buff *skb;
struct sk_buff *skb, *n;
unsigned long flags;

spin_lock_irqsave(&aun_queue_lock, flags);
skb = skb_peek(&aun_queue);
while (skb && skb != (struct sk_buff *)&aun_queue)
{
struct sk_buff *newskb = skb->next;
skb_queue_walk_safe(&aun_queue, skb, n) {
struct ec_cb *eb = (struct ec_cb *)&skb->cb;
if ((jiffies - eb->start) > eb->timeout)
{
if ((jiffies - eb->start) > eb->timeout) {
tx_result(skb->sk, eb->cookie,
ECTYPE_TRANSMIT_NOT_PRESENT);
skb_unlink(skb, &aun_queue);
kfree_skb(skb);
}
skb = newskb;
}
spin_unlock_irqrestore(&aun_queue_lock, flags);

Expand Down

0 comments on commit de10334

Please sign in to comment.