diff options
Diffstat (limited to 'drivers/net/ppp_generic.c')
-rw-r--r-- | drivers/net/ppp_generic.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index bb71638a7c44..0df7e92b0bf8 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1232,9 +1232,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1232 | navail = 0; /* total # of usable channels (not deregistered) */ | 1232 | navail = 0; /* total # of usable channels (not deregistered) */ |
1233 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; | 1233 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; |
1234 | i = 0; | 1234 | i = 0; |
1235 | list = &ppp->channels; | 1235 | list_for_each_entry(pch, &ppp->channels, clist) { |
1236 | while ((list = list->next) != &ppp->channels) { | ||
1237 | pch = list_entry(list, struct channel, clist); | ||
1238 | navail += pch->avail = (pch->chan != NULL); | 1236 | navail += pch->avail = (pch->chan != NULL); |
1239 | if (pch->avail) { | 1237 | if (pch->avail) { |
1240 | if (skb_queue_empty(&pch->file.xq) || | 1238 | if (skb_queue_empty(&pch->file.xq) || |
@@ -1280,6 +1278,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1280 | 1278 | ||
1281 | /* skip to the channel after the one we last used | 1279 | /* skip to the channel after the one we last used |
1282 | and start at that one */ | 1280 | and start at that one */ |
1281 | list = &ppp->channels; | ||
1283 | for (i = 0; i < ppp->nxchan; ++i) { | 1282 | for (i = 0; i < ppp->nxchan; ++i) { |
1284 | list = list->next; | 1283 | list = list->next; |
1285 | if (list == &ppp->channels) { | 1284 | if (list == &ppp->channels) { |
@@ -1730,7 +1729,7 @@ static void | |||
1730 | ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | 1729 | ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) |
1731 | { | 1730 | { |
1732 | u32 mask, seq; | 1731 | u32 mask, seq; |
1733 | struct list_head *l; | 1732 | struct channel *ch; |
1734 | int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; | 1733 | int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; |
1735 | 1734 | ||
1736 | if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0) | 1735 | if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0) |
@@ -1784,8 +1783,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
1784 | * The list of channels can't change because we have the receive | 1783 | * The list of channels can't change because we have the receive |
1785 | * side of the ppp unit locked. | 1784 | * side of the ppp unit locked. |
1786 | */ | 1785 | */ |
1787 | for (l = ppp->channels.next; l != &ppp->channels; l = l->next) { | 1786 | list_for_each_entry(ch, &ppp->channels, clist) { |
1788 | struct channel *ch = list_entry(l, struct channel, clist); | ||
1789 | if (seq_before(ch->lastseq, seq)) | 1787 | if (seq_before(ch->lastseq, seq)) |
1790 | seq = ch->lastseq; | 1788 | seq = ch->lastseq; |
1791 | } | 1789 | } |
@@ -2271,10 +2269,8 @@ static struct compressor_entry * | |||
2271 | find_comp_entry(int proto) | 2269 | find_comp_entry(int proto) |
2272 | { | 2270 | { |
2273 | struct compressor_entry *ce; | 2271 | struct compressor_entry *ce; |
2274 | struct list_head *list = &compressor_list; | ||
2275 | 2272 | ||
2276 | while ((list = list->next) != &compressor_list) { | 2273 | list_for_each_entry(ce, &compressor_list, list) { |
2277 | ce = list_entry(list, struct compressor_entry, list); | ||
2278 | if (ce->comp->compress_proto == proto) | 2274 | if (ce->comp->compress_proto == proto) |
2279 | return ce; | 2275 | return ce; |
2280 | } | 2276 | } |
@@ -2540,20 +2536,15 @@ static struct channel * | |||
2540 | ppp_find_channel(int unit) | 2536 | ppp_find_channel(int unit) |
2541 | { | 2537 | { |
2542 | struct channel *pch; | 2538 | struct channel *pch; |
2543 | struct list_head *list; | ||
2544 | 2539 | ||
2545 | list = &new_channels; | 2540 | list_for_each_entry(pch, &new_channels, list) { |
2546 | while ((list = list->next) != &new_channels) { | ||
2547 | pch = list_entry(list, struct channel, list); | ||
2548 | if (pch->file.index == unit) { | 2541 | if (pch->file.index == unit) { |
2549 | list_del(&pch->list); | 2542 | list_del(&pch->list); |
2550 | list_add(&pch->list, &all_channels); | 2543 | list_add(&pch->list, &all_channels); |
2551 | return pch; | 2544 | return pch; |
2552 | } | 2545 | } |
2553 | } | 2546 | } |
2554 | list = &all_channels; | 2547 | list_for_each_entry(pch, &all_channels, list) { |
2555 | while ((list = list->next) != &all_channels) { | ||
2556 | pch = list_entry(list, struct channel, list); | ||
2557 | if (pch->file.index == unit) | 2548 | if (pch->file.index == unit) |
2558 | return pch; | 2549 | return pch; |
2559 | } | 2550 | } |