summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2017-12-07 11:10:05 +0200
committerDavid Sterba <dsterba@suse.com>2018-01-31 15:14:01 +0100
commit8075fd4da1a5c759261413461a4bd7f9af81722c (patch)
treee1ce1da4ea6ef05be6bfcb191fd8642ae77e2190 /cmds-filesystem.c
parent90a00b3c79584eee7c282623c39ec88d3662be25 (diff)
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 <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> [ remove unused variable in uuid_search ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 17d399d5..25d3c0cf 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -173,7 +173,6 @@ static int match_search_item_kernel(u8 *fsid, char *mnt, char *label,
static int uuid_search(struct btrfs_fs_devices *fs_devices, const char *search)
{
char uuidbuf[BTRFS_UUID_UNPARSED_SIZE];
- struct list_head *cur;
struct btrfs_device *device;
int search_len = strlen(search);
@@ -182,8 +181,7 @@ static int uuid_search(struct btrfs_fs_devices *fs_devices, const char *search)
if (!strncmp(uuidbuf, search, search_len))
return 1;
- list_for_each(cur, &fs_devices->devices) {
- device = list_entry(cur, struct btrfs_device, dev_list);
+ list_for_each_entry(device, &fs_devices->devices, dev_list) {
if ((device->label && strcmp(device->label, search) == 0) ||
strcmp(device->name, search) == 0)
return 1;