netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDS: Simplify code
@ 2016-09-03  5:33 Christophe JAILLET
  2016-09-04 12:20 ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Christophe JAILLET @ 2016-09-03  5:33 UTC (permalink / raw)
  To: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Christophe JAILLET

Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to
'list_splice_init'.

This has been spotted with the following coccinelle script:
/////
@@
expression y,z;
@@

-   list_splice(y,z);
-   INIT_LIST_HEAD(y);
+   list_splice_init(y,z);

Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
---
 net/rds/loop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/rds/loop.c b/net/rds/loop.c
index f2bf78de5688..c3e6da4fdf97 100644
--- a/net/rds/loop.c
+++ b/net/rds/loop.c
@@ -167,8 +167,7 @@ void rds_loop_exit(void)
 
 	/* avoid calling conn_destroy with irqs off */
 	spin_lock_irq(&loop_conns_lock);
-	list_splice(&loop_conns, &tmp_list);
-	INIT_LIST_HEAD(&loop_conns);
+	list_splice_init(&loop_conns, &tmp_list);
 	spin_unlock_irq(&loop_conns_lock);
 
 	list_for_each_entry_safe(lc, _lc, &tmp_list, loop_node) {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-06  0:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-03  5:33 [PATCH] RDS: Simplify code Christophe JAILLET
2016-09-04 12:20 ` Leon Romanovsky
2016-09-04 15:57   ` Christophe JAILLET
     [not found]     ` <befa1a39-cfc5-721f-e39a-369436237b1c-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2016-09-04 18:23       ` Leon Romanovsky
     [not found]         ` <20160904182354.GR21847-2ukJVAZIZ/Y@public.gmane.org>
2016-09-05  4:38           ` Christophe JAILLET
2016-09-05  5:14             ` Leon Romanovsky
2016-09-06  0:22           ` santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA

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).