Skip to content

Commit 527123c

Browse files
ChaitanayaKulkarnikeithbusch
authored andcommitted
nvmet: configfs code cleanup
This is a pure code cleanup patch which does not change any functionality. This patch removes the extra lines, get rid of else which is duplicate for return. Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent adce7e9 commit 527123c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/nvme/target/configfs.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,12 @@ static ssize_t nvmet_ns_device_uuid_store(struct config_item *item,
395395
struct nvmet_subsys *subsys = ns->subsys;
396396
int ret = 0;
397397

398-
399398
mutex_lock(&subsys->lock);
400399
if (ns->enabled) {
401400
ret = -EBUSY;
402401
goto out_unlock;
403402
}
404403

405-
406404
if (uuid_parse(page, &ns->uuid))
407405
ret = -EINVAL;
408406

@@ -815,10 +813,10 @@ static ssize_t nvmet_subsys_attr_version_show(struct config_item *item,
815813
(int)NVME_MAJOR(subsys->ver),
816814
(int)NVME_MINOR(subsys->ver),
817815
(int)NVME_TERTIARY(subsys->ver));
818-
else
819-
return snprintf(page, PAGE_SIZE, "%d.%d\n",
820-
(int)NVME_MAJOR(subsys->ver),
821-
(int)NVME_MINOR(subsys->ver));
816+
817+
return snprintf(page, PAGE_SIZE, "%d.%d\n",
818+
(int)NVME_MAJOR(subsys->ver),
819+
(int)NVME_MINOR(subsys->ver));
822820
}
823821

824822
static ssize_t nvmet_subsys_attr_version_store(struct config_item *item,
@@ -828,7 +826,6 @@ static ssize_t nvmet_subsys_attr_version_store(struct config_item *item,
828826
int major, minor, tertiary = 0;
829827
int ret;
830828

831-
832829
ret = sscanf(page, "%d.%d.%d\n", &major, &minor, &tertiary);
833830
if (ret != 2 && ret != 3)
834831
return -EINVAL;

0 commit comments

Comments
 (0)