Skip to content

Commit

Permalink
[CASSINI]: Use shorter list_splice_init() macro for brevity.
Browse files Browse the repository at this point in the history
Signed-off-by: Robert P. J. Day <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
rpjday authored and davem330 committed Mar 24, 2008
1 parent 80445cf commit 9bd512f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,7 @@ static void cas_spare_free(struct cas *cp)
/* free spare buffers */
INIT_LIST_HEAD(&list);
spin_lock(&cp->rx_spare_lock);
list_splice(&cp->rx_spare_list, &list);
INIT_LIST_HEAD(&cp->rx_spare_list);
list_splice_init(&cp->rx_spare_list, &list);
spin_unlock(&cp->rx_spare_lock);
list_for_each_safe(elem, tmp, &list) {
cas_page_free(cp, list_entry(elem, cas_page_t, list));
Expand All @@ -546,13 +545,11 @@ static void cas_spare_free(struct cas *cp)
* lock than used everywhere else to manipulate this list.
*/
spin_lock(&cp->rx_inuse_lock);
list_splice(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
list_splice_init(&cp->rx_inuse_list, &list);
spin_unlock(&cp->rx_inuse_lock);
#else
spin_lock(&cp->rx_spare_lock);
list_splice(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
list_splice_init(&cp->rx_inuse_list, &list);
spin_unlock(&cp->rx_spare_lock);
#endif
list_for_each_safe(elem, tmp, &list) {
Expand All @@ -573,8 +570,7 @@ static void cas_spare_recover(struct cas *cp, const gfp_t flags)
/* make a local copy of the list */
INIT_LIST_HEAD(&list);
spin_lock(&cp->rx_inuse_lock);
list_splice(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
list_splice_init(&cp->rx_inuse_list, &list);
spin_unlock(&cp->rx_inuse_lock);

list_for_each_safe(elem, tmp, &list) {
Expand Down

0 comments on commit 9bd512f

Please sign in to comment.