Avoid a totally pointless goto label, and use the same style of
comparism for both helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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;
}
/**
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)