author: Christoph Hellwig <hch@lst.de> 2020-11-14 19:41:48 +0100
committer: Jens Axboe <axboe@kernel.dk> 2020-12-01 14:53:39 -0700
commit: 013b0e96ae2225a649b48a2f8fc4f87429483cb1
parent: e036bb8e0cdf9dbac3b76fb0a576100eaa81f0be
Commit Summary:
Diffstat:
1 file changed, 6 insertions, 10 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index afa26a4028d2..5879edf083b3 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -79,15 +79,10 @@ static int match_dev_by_uuid(struct device *dev, const void *data)
const struct uuidcmp *cmp = data;
struct hd_struct *part = dev_to_part(dev);
- if (!part->info)
- goto no_match;
-
- if (strncasecmp(cmp->uuid, part->info->uuid, cmp->len))
- goto no_match;
-
+ if (!part->info ||
+ strncasecmp(cmp->uuid, part->info->uuid, cmp->len))
+ return 0;
return 1;
-no_match:
- return 0;
}
/**
@@ -174,10 +169,9 @@ static int match_dev_by_label(struct device *dev, const void *data)
const char *label = data;
struct hd_struct *part = dev_to_part(dev);
- if (part->info && !strcmp(label, part->info->volname))
- return 1;
-
- return 0;
+ if (!part->info || strcmp(label, part->info->volname))
+ return 0;
+ return 1;
}
static dev_t devt_from_partlabel(const char *label)