All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/3] lnvm: minor clean-ups
@ 2019-07-23 14:42 Minwoo Im
  2019-07-23 14:42 ` [PATCH 1/3] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Minwoo Im @ 2019-07-23 14:42 UTC (permalink / raw)


Hi Keith,

This series has been reviewed by Matias and Javier.  Please consider
this series to be merged.  The Github PR can be found at:
	https://github.com/linux-nvme/nvme-cli/pull/527

This series is nothing but a clean-up patch series.  I hope it's not a
just code churns, but a good start to do something for lnvm.

The first one removed a redundant whitespace in the command description.
The second one removed unnecessary print for the sizeof(dev) which will
always be zero in case user does not give any argument for the device.
The third patch removed temp variable instead casting the pinter
directly.  The last one just sync-up the kernel UAPI header file to the
latest.

Please review.

Thanks,

Changes to V3:
  - Drop the last commit which is about the re-sync for the UAPI header
    file from the kernel because it does not have any actual using code.
    (Matias)
  - Added Reviewed-by tag from Javier. (Javier)

Changes to V2:
  - Resend the series with the latest patch commits.

Minwoo Im (3):
  lnvm: remove redundant whitespace in lnvm_init()
  lnvm: do not print 0 when the arg is not given
  lnvm: cast identity structure to (void *) directly

 nvme-lightnvm.c          | 5 ++---
 plugins/lnvm/lnvm-nvme.c | 8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] lnvm: remove redundant whitespace in lnvm_init()
  2019-07-23 14:42 [PATCH V3 0/3] lnvm: minor clean-ups Minwoo Im
@ 2019-07-23 14:42 ` Minwoo Im
  2019-07-23 14:42 ` [PATCH 2/3] lnvm: do not print 0 when the arg is not given Minwoo Im
  2019-07-23 14:42 ` [PATCH 3/3] lnvm: cast identity structure to (void *) directly Minwoo Im
  2 siblings, 0 replies; 4+ messages in thread
From: Minwoo Im @ 2019-07-23 14:42 UTC (permalink / raw)


The description for lnvm-init subcommand has a redundant whitespace.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
Reviewed-by: Javier Gonz?lez <javier at javigon.com>
---
 plugins/lnvm/lnvm-nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
index 754931a..37b6733 100644
--- a/plugins/lnvm/lnvm-nvme.c
+++ b/plugins/lnvm/lnvm-nvme.c
@@ -17,7 +17,7 @@
 static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
 	const char *desc = "Initialize LightNVM device. A LightNVM/Open-Channel SSD"\
-			   " must have a media manager associated before it can "\
+			   " must have a media manager associated before it can"\
 			   " be exposed to the user. The default is to initialize"
 			   " the general media manager on top of the device.\n\n"
 			   "Example:"
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] lnvm: do not print 0 when the arg is not given
  2019-07-23 14:42 [PATCH V3 0/3] lnvm: minor clean-ups Minwoo Im
  2019-07-23 14:42 ` [PATCH 1/3] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
@ 2019-07-23 14:42 ` Minwoo Im
  2019-07-23 14:42 ` [PATCH 3/3] lnvm: cast identity structure to (void *) directly Minwoo Im
  2 siblings, 0 replies; 4+ messages in thread
From: Minwoo Im @ 2019-07-23 14:42 UTC (permalink / raw)


If an argument is not given by the user, it just needs to show the
situation, not a prominent 0 which indicates the size of the argument
variable.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
Reviewed-by: Javier Gonz?lez <javier at javigon.com>
---
 plugins/lnvm/lnvm-nvme.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
index 37b6733..aacd469 100644
--- a/plugins/lnvm/lnvm-nvme.c
+++ b/plugins/lnvm/lnvm-nvme.c
@@ -48,7 +48,7 @@ static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 
@@ -179,7 +179,7 @@ static int lnvm_create_tgt(int argc, char **argv, struct command *cmd, struct pl
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 	if (!strlen(cfg.tgtname)) {
@@ -265,7 +265,7 @@ static int lnvm_factory_init(int argc, char **argv, struct command *cmd, struct
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] lnvm: cast identity structure to (void *) directly
  2019-07-23 14:42 [PATCH V3 0/3] lnvm: minor clean-ups Minwoo Im
  2019-07-23 14:42 ` [PATCH 1/3] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
  2019-07-23 14:42 ` [PATCH 2/3] lnvm: do not print 0 when the arg is not given Minwoo Im
@ 2019-07-23 14:42 ` Minwoo Im
  2 siblings, 0 replies; 4+ messages in thread
From: Minwoo Im @ 2019-07-23 14:42 UTC (permalink / raw)


If we use "tmp" or something like this, we can expect that it just
stores the previous pointer and do something else with the previous
pointer.  But, in this function, it just to cast it out.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
Reviewed-by: Javier Gonz?lez <javier at javigon.com>
---
 nvme-lightnvm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nvme-lightnvm.c b/nvme-lightnvm.c
index 0b99786..62bdc40 100644
--- a/nvme-lightnvm.c
+++ b/nvme-lightnvm.c
@@ -422,13 +422,12 @@ static void show_lnvm_id20_ns(struct nvme_nvm_id20 *id, unsigned int flags)
 
 static void show_lnvm_id_ns(struct nvme_nvm_id *id, unsigned int flags)
 {
-	void *tmp = id;
 	switch (id->ver_id) {
 		case 1:
-			show_lnvm_id12_ns(tmp, flags);
+			show_lnvm_id12_ns((void *) id, flags);
 		break;
 		case 2:
-			show_lnvm_id20_ns(tmp, flags);
+			show_lnvm_id20_ns((void *) id, flags);
 		break;
 		default:
 			fprintf(stderr, "Version %d not supported.\n",
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-23 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-23 14:42 [PATCH V3 0/3] lnvm: minor clean-ups Minwoo Im
2019-07-23 14:42 ` [PATCH 1/3] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
2019-07-23 14:42 ` [PATCH 2/3] lnvm: do not print 0 when the arg is not given Minwoo Im
2019-07-23 14:42 ` [PATCH 3/3] lnvm: cast identity structure to (void *) directly Minwoo Im

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.