staging: lustre: lnet: Use list_entry() rather than container_of()
authorJanani Ravichandran <janani.rvchndrn@gmail.com>
Sun, 28 Feb 2016 19:09:12 +0000 (14:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2016 03:38:34 +0000 (19:38 -0800)
Use list_entry() rather than container_of() for nodes of doubly linked
lists.
Semantic patch used:

@a exists@
identifier var;
struct list_head *ptr;
@@

  var =
- container_of
+ list_entry
  (ptr, ...);

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c

index 06084315fdd14b8703ffb486190227c7108a75b4..866e2bf50f2c3fc1930e5cef4a330a02297d5f13 100644 (file)
@@ -113,7 +113,7 @@ kiblnd_get_idle_tx(lnet_ni_t *ni, lnet_nid_t target)
        node = kiblnd_pool_alloc_node(&tps->tps_poolset);
        if (!node)
                return NULL;
-       tx = container_of(node, kib_tx_t, tx_list);
+       tx = list_entry(node, kib_tx_t, tx_list);
 
        LASSERT(!tx->tx_nwrq);
        LASSERT(!tx->tx_queued);