]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
MAINT: Fix format compile warning error on 32 bit system
authorTokunori Ikegami <ikegami.t@gmail.com>
Wed, 27 Nov 2019 15:53:04 +0000 (00:53 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 3 Dec 2019 21:24:01 +0000 (14:24 -0700)
Since the following %lx format warning error was caused on 64 bit system.

  error: format ‘%lx’ expects argument of type ‘long unsigned int’,
  but argument 2 has type ‘long long unsigned int’ [-Werror=format=]

So fix this by using %" PRIx64 " format instead as generic.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme-print.c

index 706d038c3134a25088acfb219c27747a5824200a..2ba1de119cb6e004ab2b677164a46b14e91147c8 100644 (file)
@@ -1184,9 +1184,9 @@ static void nvme_show_registers_bpmbl(uint64_t bpmbl)
 
 static void nvme_show_registers_cmbmsc(uint64_t cmbmsc)
 {
-       printf("\tController Base Address (CBA)      : %lx\n",
+       printf("\tController Base Address (CBA)      : %" PRIx64 "\n",
                        (cmbmsc & 0xfffffffffffff000) >> 12);
-       printf("\tController Memory Space Enable (CMSE): %lx\n",
+       printf("\tController Memory Space Enable (CMSE): %" PRIx64 "\n",
                        (cmbmsc & 0x0000000000000002) >> 1);
        printf("\tCapabilities Registers Enabled (CRE) : CMBLOC and "\
               "CMBSZ registers are%senabled\n\n",
@@ -1280,9 +1280,9 @@ static void nvme_show_registers_pmrswtp(__u32 pmrswtp)
 
 static void nvme_show_registers_pmrmsc(uint64_t pmrmsc)
 {
-       printf("\tController Base Address (CBA)         : %lx\n",
+       printf("\tController Base Address (CBA)         : %" PRIx64 "\n",
                (pmrmsc & 0xfffffffffffff000) >> 12);
-       printf("\tController Memory Space Enable (CMSE  : %lx\n\n",
+       printf("\tController Memory Space Enable (CMSE  : %" PRIx64 "\n\n",
                (pmrmsc & 0x0000000000000001) >> 1);
 }