From 8075fd4da1a5c759261413461a4bd7f9af81722c Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Thu, 7 Dec 2017 11:10:05 +0200 Subject: btrfs-progs: Replace usage of list_for_each with list_for_each_entry There are a couple of places where instead of the more succinct list_for_each_entry the code uses list_for_each. This results in slightly more code with no additional benefit as well as no coherent pattern. This patch makes the code uniform. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: Qu Wenruo [ remove unused variable in uuid_search ] Signed-off-by: David Sterba --- utils.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 3d0369f0..4a16413c 100644 --- a/utils.c +++ b/utils.c @@ -819,14 +819,9 @@ static int blk_file_in_dev_list(struct btrfs_fs_devices* fs_devices, const char* file) { int ret; - struct list_head *head; - struct list_head *cur; struct btrfs_device *device; - head = &fs_devices->devices; - list_for_each(cur, head) { - device = list_entry(cur, struct btrfs_device, dev_list); - + list_for_each_entry(device, &fs_devices->devices, dev_list) { if((ret = is_same_loop_file(device->name, file))) return ret; } -- cgit v1.2.3