]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: lustre: lov: use list_for_each_entry in lov_obd.c
authorNeilBrown <neilb@suse.com>
Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2017 11:32:12 +0000 (12:32 +0100)
Using the *_entry macro simplifies the code slightly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_obd.c

index 7ce01026a40937e1c62ede11be647e9eb15cefdd..ec70c12e5b40d46b53bb11ecbdc2ca8cbc991248 100644 (file)
@@ -828,11 +828,9 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 static int lov_cleanup(struct obd_device *obd)
 {
        struct lov_obd *lov = &obd->u.lov;
-       struct list_head *pos, *tmp;
-       struct pool_desc *pool;
+       struct pool_desc *pool, *tmp;
 
-       list_for_each_safe(pos, tmp, &lov->lov_pool_list) {
-               pool = list_entry(pos, struct pool_desc, pool_list);
+       list_for_each_entry_safe(pool, tmp, &lov->lov_pool_list, pool_list) {
                /* free pool structs */
                CDEBUG(D_INFO, "delete pool %p\n", pool);
                /* In the function below, .hs_keycmp resolves to