dm table: simplify call to free_devices
authorHannes Reinecke <hare@suse.de>
Wed, 28 Mar 2012 17:41:24 +0000 (18:41 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Wed, 28 Mar 2012 17:41:24 +0000 (18:41 +0100)
free_devices in dm_table.c already uses list_for_each(), so we don't
need to check if the list is empty.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-table.c

index 63cc54289afff481c1d4ce8a9cc2e6749de8b5de..a3d1e18317f4e548648c36bcc4f78a57e842f1d4 100644 (file)
@@ -268,8 +268,7 @@ void dm_table_destroy(struct dm_table *t)
        vfree(t->highs);
 
        /* free the device list */
-       if (t->devices.next != &t->devices)
-               free_devices(&t->devices);
+       free_devices(&t->devices);
 
        dm_free_md_mempools(t->mempools);