]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
use common whitespace strip
authorKeith Busch <kbusch@kernel.org>
Mon, 1 Jun 2020 14:09:59 +0000 (07:09 -0700)
committerKeith Busch <kbusch@kernel.org>
Mon, 1 Jun 2020 14:09:59 +0000 (07:09 -0700)
Signed-off-by: Keith Busch <kbusch@kernel.org>
libnvme
util/user-types.h

diff --git a/libnvme b/libnvme
index 5fca2499aa7342ab7b57067982e54822409c8561..af59d4979e10b8378fbeb76efe73917464ca374d 160000 (submodule)
--- a/libnvme
+++ b/libnvme
@@ -1 +1 @@
-Subproject commit 5fca2499aa7342ab7b57067982e54822409c8561
+Subproject commit af59d4979e10b8378fbeb76efe73917464ca374d
index 4d18269b0507fb30705f0995d14f411955157607..cbd0b026216bd87dd31f51fac722f0b40e02c993 100644 (file)
@@ -370,12 +370,6 @@ static inline void nvme_json_add_hex_le16(struct json_object *j,
        nvme_json_add_hex(j, n, le16_to_cpu(v), flags);
 }
 
-static void chomp(char *s, int l)
-{
-       while (l && (s[l] == '\0' || s[l] == ' '))
-               s[l--] = '\0';
-}
-
 static inline void nvme_json_add_str_flags(struct json_object *j, const char *n,
                                          const char *v, int l, unsigned long flags)
 {
@@ -387,7 +381,7 @@ static inline void nvme_json_add_str_flags(struct json_object *j, const char *n,
        }
 
         snprintf(buf, sizeof(buf), "%-.*s", l, v);
-       chomp(buf, l);
+       nvme_chomp(buf, l);
 
        nvme_json_add_str(j, n, buf, flags);
 }