Commit 9bd512f6 authored by Robert P. J. Day's avatar Robert P. J. Day Committed by David S. Miller

[CASSINI]: Use shorter list_splice_init() macro for brevity.

Signed-off-by: default avatarRobert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80445cfb
...@@ -532,8 +532,7 @@ static void cas_spare_free(struct cas *cp) ...@@ -532,8 +532,7 @@ static void cas_spare_free(struct cas *cp)
/* free spare buffers */ /* free spare buffers */
INIT_LIST_HEAD(&list); INIT_LIST_HEAD(&list);
spin_lock(&cp->rx_spare_lock); spin_lock(&cp->rx_spare_lock);
list_splice(&cp->rx_spare_list, &list); list_splice_init(&cp->rx_spare_list, &list);
INIT_LIST_HEAD(&cp->rx_spare_list);
spin_unlock(&cp->rx_spare_lock); spin_unlock(&cp->rx_spare_lock);
list_for_each_safe(elem, tmp, &list) { list_for_each_safe(elem, tmp, &list) {
cas_page_free(cp, list_entry(elem, cas_page_t, list)); cas_page_free(cp, list_entry(elem, cas_page_t, list));
...@@ -546,13 +545,11 @@ static void cas_spare_free(struct cas *cp) ...@@ -546,13 +545,11 @@ static void cas_spare_free(struct cas *cp)
* lock than used everywhere else to manipulate this list. * lock than used everywhere else to manipulate this list.
*/ */
spin_lock(&cp->rx_inuse_lock); spin_lock(&cp->rx_inuse_lock);
list_splice(&cp->rx_inuse_list, &list); list_splice_init(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
spin_unlock(&cp->rx_inuse_lock); spin_unlock(&cp->rx_inuse_lock);
#else #else
spin_lock(&cp->rx_spare_lock); spin_lock(&cp->rx_spare_lock);
list_splice(&cp->rx_inuse_list, &list); list_splice_init(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
spin_unlock(&cp->rx_spare_lock); spin_unlock(&cp->rx_spare_lock);
#endif #endif
list_for_each_safe(elem, tmp, &list) { list_for_each_safe(elem, tmp, &list) {
...@@ -573,8 +570,7 @@ static void cas_spare_recover(struct cas *cp, const gfp_t flags) ...@@ -573,8 +570,7 @@ static void cas_spare_recover(struct cas *cp, const gfp_t flags)
/* make a local copy of the list */ /* make a local copy of the list */
INIT_LIST_HEAD(&list); INIT_LIST_HEAD(&list);
spin_lock(&cp->rx_inuse_lock); spin_lock(&cp->rx_inuse_lock);
list_splice(&cp->rx_inuse_list, &list); list_splice_init(&cp->rx_inuse_list, &list);
INIT_LIST_HEAD(&cp->rx_inuse_list);
spin_unlock(&cp->rx_inuse_lock); spin_unlock(&cp->rx_inuse_lock);
list_for_each_safe(elem, tmp, &list) { list_for_each_safe(elem, tmp, &list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment