Skip to content

Commit fd8099e

Browse files
author
Christoph Hellwig
committed
nvme: cleanup __nvme_check_ids
Pass the actual nvme_ns_ids used for the comparison instead of the ns_head that isn't needed and use a more descriptive function name. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]>
1 parent 0a9f850 commit fd8099e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,16 +3673,15 @@ static struct nvme_ns_head *nvme_find_ns_head(struct nvme_subsystem *subsys,
36733673
return NULL;
36743674
}
36753675

3676-
static int __nvme_check_ids(struct nvme_subsystem *subsys,
3677-
struct nvme_ns_head *new)
3676+
static int nvme_subsys_check_duplicate_ids(struct nvme_subsystem *subsys,
3677+
struct nvme_ns_ids *ids)
36783678
{
36793679
struct nvme_ns_head *h;
36803680

36813681
lockdep_assert_held(&subsys->lock);
36823682

36833683
list_for_each_entry(h, &subsys->nsheads, entry) {
3684-
if (nvme_ns_ids_valid(&new->ids) &&
3685-
nvme_ns_ids_equal(&new->ids, &h->ids))
3684+
if (nvme_ns_ids_valid(ids) && nvme_ns_ids_equal(ids, &h->ids))
36863685
return -EINVAL;
36873686
}
36883687

@@ -3781,7 +3780,7 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
37813780
head->ids = *ids;
37823781
kref_init(&head->ref);
37833782

3784-
ret = __nvme_check_ids(ctrl->subsys, head);
3783+
ret = nvme_subsys_check_duplicate_ids(ctrl->subsys, &head->ids);
37853784
if (ret) {
37863785
dev_err(ctrl->device,
37873786
"duplicate IDs for nsid %d\n", nsid);

0 commit comments

Comments
 (0)