From: Wei Yang <richardw.yang@linux.intel.com>
To: linux-nvdimm@lists.01.org
Cc: zwisler@kernel.org
Subject: [PATCH 2/5] libnvdimm, namespace: remove special handling when count == 0
Date: Mon, 28 Jan 2019 08:30:15 +0800 [thread overview]
Message-ID: <20190128003018.4087-2-richardw.yang@linux.intel.com> (raw)
In-Reply-To: <20190128003018.4087-1-richardw.yang@linux.intel.com>
This is reasonable to continue directly when count == 0, while this case
could be merged in following for loop.
count == 0, j == 0 => j >= count, loop continues.
This patch just removes the special handling to make the code look more
neat.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
drivers/nvdimm/namespace_devs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 234c0c79726a..0d64c4b38a56 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -2485,8 +2485,6 @@ static int init_active_labels(struct nd_region *nd_region)
count = nd_label_active_count(ndd);
dev_dbg(ndd->dev, "count: %d\n", count);
- if (!count)
- continue;
for (j = 0; j < count; j++) {
struct nd_namespace_label *label;
--
2.19.1
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2019-01-28 0:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 0:30 [PATCH 1/5] libnvdimm, namespace: release labels properly on error Wei Yang
2019-01-28 0:30 ` Wei Yang [this message]
2019-01-28 0:30 ` [PATCH 3/5] libnvdimm, label: return nd_label directly instead of calculating it again Wei Yang
2019-01-28 0:30 ` [PATCH 4/5] libnvdimm, namespace: extract __init_active_labels to initialize labels for one nd_mapping Wei Yang
2019-01-28 0:30 ` [PATCH 5/5] libnvdimm, namespace: allocate devs for namespace just once Wei Yang
2019-02-01 6:42 ` [PATCH 1/5] libnvdimm, namespace: release labels properly on error Wei Yang
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=20190128003018.4087-2-richardw.yang@linux.intel.com \
--to=richardw.yang@linux.intel.com \
--cc=linux-nvdimm@lists.01.org \
--cc=zwisler@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.