Skip to content

Commit d9db393

Browse files
Luo Yifanbjorn-helgaas
Luo Yifan
authored andcommitted
tools: PCI: Fix incorrect printf format specifiers
Fix several incorrect printf format specifiers that misused signed and unsigned versions. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Luo Yifan <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 3ca2589 commit d9db393

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/pci/pcitest.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int run_test(struct pci_test *test)
9595

9696
if (test->msinum > 0 && test->msinum <= 32) {
9797
ret = ioctl(fd, PCITEST_MSI, test->msinum);
98-
fprintf(stdout, "MSI%d:\t\t", test->msinum);
98+
fprintf(stdout, "MSI%u:\t\t", test->msinum);
9999
if (ret < 0)
100100
fprintf(stdout, "TEST FAILED\n");
101101
else
@@ -104,7 +104,7 @@ static int run_test(struct pci_test *test)
104104

105105
if (test->msixnum > 0 && test->msixnum <= 2048) {
106106
ret = ioctl(fd, PCITEST_MSIX, test->msixnum);
107-
fprintf(stdout, "MSI-X%d:\t\t", test->msixnum);
107+
fprintf(stdout, "MSI-X%u:\t\t", test->msixnum);
108108
if (ret < 0)
109109
fprintf(stdout, "TEST FAILED\n");
110110
else
@@ -116,7 +116,7 @@ static int run_test(struct pci_test *test)
116116
if (test->use_dma)
117117
param.flags = PCITEST_FLAGS_USE_DMA;
118118
ret = ioctl(fd, PCITEST_WRITE, &param);
119-
fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size);
119+
fprintf(stdout, "WRITE (%7lu bytes):\t\t", test->size);
120120
if (ret < 0)
121121
fprintf(stdout, "TEST FAILED\n");
122122
else
@@ -128,7 +128,7 @@ static int run_test(struct pci_test *test)
128128
if (test->use_dma)
129129
param.flags = PCITEST_FLAGS_USE_DMA;
130130
ret = ioctl(fd, PCITEST_READ, &param);
131-
fprintf(stdout, "READ (%7ld bytes):\t\t", test->size);
131+
fprintf(stdout, "READ (%7lu bytes):\t\t", test->size);
132132
if (ret < 0)
133133
fprintf(stdout, "TEST FAILED\n");
134134
else
@@ -140,7 +140,7 @@ static int run_test(struct pci_test *test)
140140
if (test->use_dma)
141141
param.flags = PCITEST_FLAGS_USE_DMA;
142142
ret = ioctl(fd, PCITEST_COPY, &param);
143-
fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size);
143+
fprintf(stdout, "COPY (%7lu bytes):\t\t", test->size);
144144
if (ret < 0)
145145
fprintf(stdout, "TEST FAILED\n");
146146
else

0 commit comments

Comments
 (0)