]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix print format specifiers
authorKeith Busch <keith.busch@intel.com>
Tue, 29 Jan 2019 00:58:13 +0000 (17:58 -0700)
committerKeith Busch <keith.busch@intel.com>
Tue, 29 Jan 2019 00:58:13 +0000 (17:58 -0700)
User the macros for different archs.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index d19bdd66de7901cc24faf5966a1af96639b5aef0..7cf65a9166c0b758cac738fc91cf7375dfe0be15 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1213,7 +1213,8 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin *
        if (cfg.bs) {
                if ((cfg.bs & (~cfg.bs + 1)) != cfg.bs) {
                        fprintf(stderr,
-                               "Invalid value for block size (%llu). Block size must be a power of two\n", cfg.bs);
+                               "Invalid value for block size (%"PRIu64"). Block size must be a power of two\n",
+                               (uint64_t)cfg.bs);
                        return EINVAL;
                }
                err = nvme_identify_ns(fd, NVME_NSID_ALL, 0, &ns);
@@ -1236,7 +1237,8 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin *
        }
        if (cfg.flbas == 0xff) {
                fprintf(stderr,
-                       "FLBAS corresponding to block size %llu not found\n", cfg.bs);
+                       "FLBAS corresponding to block size %"PRIu64" not found\n",
+                       (uint64_t)cfg.bs);
                fprintf(stderr,
                        "Please correct block size, or specify FLBAS directly\n");
                return EINVAL;
@@ -3156,7 +3158,8 @@ static int format(int argc, char **argv, struct command *cmd, struct plugin *plu
                }
                        if (cfg.lbaf == 0xff) {
                                fprintf(stderr,
-                                       "LBAF corresponding to block size %llu (LBAF %u) not found\n", cfg.bs, lbads);
+                                       "LBAF corresponding to block size %"PRIu64" (LBAF %u) not found\n",
+                                       (uint64_t)cfg.bs, lbads);
                                fprintf(stderr,
                                        "Please correct block size, or specify LBAF directly\n");
                                return EINVAL;