From: javier@javigon.com
To: linux-nvme@lists.infradead.org
Cc: linux-block@vger.kernel.org, hch@lst.de, kbusch@kernel.org,
sagi@grimberg.me, "Javier González" <javier.gonz@samsung.com>
Subject: [PATCH 1/4] nvme: remove unnecessary return values
Date: Tue, 1 Dec 2020 13:56:07 +0100 [thread overview]
Message-ID: <20201201125610.17138-2-javier.gonz@samsung.com> (raw)
In-Reply-To: <20201201125610.17138-1-javier.gonz@samsung.com>
From: Javier González <javier.gonz@samsung.com>
Cleanup unnecessary ret values that are not checked or used in
nvme_alloc_ns().
Signed-off-by: Javier González <javier.gonz@samsung.com>
---
drivers/nvme/host/core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 170745d4a34b..a965a8d28ba0 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3831,7 +3831,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
struct gendisk *disk;
struct nvme_id_ns *id;
char disk_name[DISK_NAME_LEN];
- int node = ctrl->numa_node, flags = GENHD_FL_EXT_DEVT, ret;
+ int node = ctrl->numa_node, flags = GENHD_FL_EXT_DEVT;
if (nvme_identify_ns(ctrl, nsid, ids, &id))
return;
@@ -3855,8 +3855,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
ns->ctrl = ctrl;
kref_init(&ns->kref);
- ret = nvme_init_ns_head(ns, nsid, ids, id->nmic & NVME_NS_NMIC_SHARED);
- if (ret)
+ if (nvme_init_ns_head(ns, nsid, ids, id->nmic & NVME_NS_NMIC_SHARED))
goto out_free_queue;
nvme_set_disk_name(disk_name, ns, ctrl, &flags);
@@ -3875,8 +3874,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
goto out_put_disk;
if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) {
- ret = nvme_nvm_register(ns, disk_name, node);
- if (ret) {
+ if (nvme_nvm_register(ns, disk_name, node)) {
dev_warn(ctrl->device, "LightNVM init failure\n");
goto out_put_disk;
}
--
2.17.1
next prev parent reply other threads:[~2020-12-01 12:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 12:56 [PATCH 0/4] nvme: enable per-namespace char device javier
2020-12-01 12:56 ` javier [this message]
2020-12-01 14:04 ` [PATCH 1/4] nvme: remove unnecessary return values Minwoo Im
2020-12-01 12:56 ` [PATCH 2/4] nvme: rename controller base dev_t char device javier
2020-12-01 14:05 ` Minwoo Im
2020-12-01 12:56 ` [PATCH 3/4] nvme: rename bdev operations javier
2020-12-01 14:06 ` Minwoo Im
2020-12-01 12:56 ` [PATCH 4/4] nvme: enable char device per namespace javier
2020-12-01 14:03 ` Minwoo Im
2020-12-01 18:57 ` Javier González
2020-12-01 19:30 ` Keith Busch
2020-12-01 19:38 ` Christoph Hellwig
2020-12-01 20:44 ` Javier González
2020-12-07 14:06 ` Christoph Hellwig
2020-12-02 3:00 ` Minwoo Im
2020-12-01 19:35 ` [PATCH 0/4] nvme: enable per-namespace char device Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201201125610.17138-2-javier.gonz@samsung.com \
--to=javier@javigon.com \
--cc=hch@lst.de \
--cc=javier.gonz@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox