Commit 527123c7 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Keith Busch

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent adce7e98
...@@ -395,14 +395,12 @@ static ssize_t nvmet_ns_device_uuid_store(struct config_item *item, ...@@ -395,14 +395,12 @@ static ssize_t nvmet_ns_device_uuid_store(struct config_item *item,
struct nvmet_subsys *subsys = ns->subsys; struct nvmet_subsys *subsys = ns->subsys;
int ret = 0; int ret = 0;
mutex_lock(&subsys->lock); mutex_lock(&subsys->lock);
if (ns->enabled) { if (ns->enabled) {
ret = -EBUSY; ret = -EBUSY;
goto out_unlock; goto out_unlock;
} }
if (uuid_parse(page, &ns->uuid)) if (uuid_parse(page, &ns->uuid))
ret = -EINVAL; ret = -EINVAL;
...@@ -815,10 +813,10 @@ static ssize_t nvmet_subsys_attr_version_show(struct config_item *item, ...@@ -815,10 +813,10 @@ static ssize_t nvmet_subsys_attr_version_show(struct config_item *item,
(int)NVME_MAJOR(subsys->ver), (int)NVME_MAJOR(subsys->ver),
(int)NVME_MINOR(subsys->ver), (int)NVME_MINOR(subsys->ver),
(int)NVME_TERTIARY(subsys->ver)); (int)NVME_TERTIARY(subsys->ver));
else
return snprintf(page, PAGE_SIZE, "%d.%d\n", return snprintf(page, PAGE_SIZE, "%d.%d\n",
(int)NVME_MAJOR(subsys->ver), (int)NVME_MAJOR(subsys->ver),
(int)NVME_MINOR(subsys->ver)); (int)NVME_MINOR(subsys->ver));
} }
static ssize_t nvmet_subsys_attr_version_store(struct config_item *item, 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, ...@@ -828,7 +826,6 @@ static ssize_t nvmet_subsys_attr_version_store(struct config_item *item,
int major, minor, tertiary = 0; int major, minor, tertiary = 0;
int ret; int ret;
ret = sscanf(page, "%d.%d.%d\n", &major, &minor, &tertiary); ret = sscanf(page, "%d.%d.%d\n", &major, &minor, &tertiary);
if (ret != 2 && ret != 3) if (ret != 2 && ret != 3)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment