Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] tools: PCI: Fix several incorrect format specifiers
@ 2024-11-12  9:09 Luo Yifan
  2024-11-15 11:30 ` Manivannan Sadhasivam
  2024-11-20 20:22 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Luo Yifan @ 2024-11-12  9:09 UTC (permalink / raw)
  To: helgaas, manivannan.sadhasivam, kw, kishon
  Cc: linux-pci, linux-kernel, Luo Yifan

Make a minor change to eliminate static checker warnings. Fix several
incorrect format specifiers that misused signed and unsigned versions.

Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
---
 tools/pci/pcitest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index 470258009..7b530d838 100644
--- a/tools/pci/pcitest.c
+++ b/tools/pci/pcitest.c
@@ -95,7 +95,7 @@ static int run_test(struct pci_test *test)
 
 	if (test->msinum > 0 && test->msinum <= 32) {
 		ret = ioctl(fd, PCITEST_MSI, test->msinum);
-		fprintf(stdout, "MSI%d:\t\t", test->msinum);
+		fprintf(stdout, "MSI%u:\t\t", test->msinum);
 		if (ret < 0)
 			fprintf(stdout, "TEST FAILED\n");
 		else
@@ -104,7 +104,7 @@ static int run_test(struct pci_test *test)
 
 	if (test->msixnum > 0 && test->msixnum <= 2048) {
 		ret = ioctl(fd, PCITEST_MSIX, test->msixnum);
-		fprintf(stdout, "MSI-X%d:\t\t", test->msixnum);
+		fprintf(stdout, "MSI-X%u:\t\t", test->msixnum);
 		if (ret < 0)
 			fprintf(stdout, "TEST FAILED\n");
 		else
@@ -116,7 +116,7 @@ static int run_test(struct pci_test *test)
 		if (test->use_dma)
 			param.flags = PCITEST_FLAGS_USE_DMA;
 		ret = ioctl(fd, PCITEST_WRITE, &param);
-		fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size);
+		fprintf(stdout, "WRITE (%7lu bytes):\t\t", test->size);
 		if (ret < 0)
 			fprintf(stdout, "TEST FAILED\n");
 		else
@@ -128,7 +128,7 @@ static int run_test(struct pci_test *test)
 		if (test->use_dma)
 			param.flags = PCITEST_FLAGS_USE_DMA;
 		ret = ioctl(fd, PCITEST_READ, &param);
-		fprintf(stdout, "READ (%7ld bytes):\t\t", test->size);
+		fprintf(stdout, "READ (%7lu bytes):\t\t", test->size);
 		if (ret < 0)
 			fprintf(stdout, "TEST FAILED\n");
 		else
@@ -140,7 +140,7 @@ static int run_test(struct pci_test *test)
 		if (test->use_dma)
 			param.flags = PCITEST_FLAGS_USE_DMA;
 		ret = ioctl(fd, PCITEST_COPY, &param);
-		fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size);
+		fprintf(stdout, "COPY (%7lu bytes):\t\t", test->size);
 		if (ret < 0)
 			fprintf(stdout, "TEST FAILED\n");
 		else
-- 
2.27.0




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

* Re: [PATCH] tools: PCI: Fix several incorrect format specifiers
  2024-11-12  9:09 [PATCH] tools: PCI: Fix several incorrect format specifiers Luo Yifan
@ 2024-11-15 11:30 ` Manivannan Sadhasivam
  2024-11-20 20:22 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2024-11-15 11:30 UTC (permalink / raw)
  To: Luo Yifan; +Cc: helgaas, kw, kishon, linux-pci, linux-kernel

On Tue, Nov 12, 2024 at 05:09:24PM +0800, Luo Yifan wrote:
> Make a minor change to eliminate static checker warnings. Fix several
> incorrect format specifiers that misused signed and unsigned versions.
> 
> Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  tools/pci/pcitest.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
> index 470258009..7b530d838 100644
> --- a/tools/pci/pcitest.c
> +++ b/tools/pci/pcitest.c
> @@ -95,7 +95,7 @@ static int run_test(struct pci_test *test)
>  
>  	if (test->msinum > 0 && test->msinum <= 32) {
>  		ret = ioctl(fd, PCITEST_MSI, test->msinum);
> -		fprintf(stdout, "MSI%d:\t\t", test->msinum);
> +		fprintf(stdout, "MSI%u:\t\t", test->msinum);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -104,7 +104,7 @@ static int run_test(struct pci_test *test)
>  
>  	if (test->msixnum > 0 && test->msixnum <= 2048) {
>  		ret = ioctl(fd, PCITEST_MSIX, test->msixnum);
> -		fprintf(stdout, "MSI-X%d:\t\t", test->msixnum);
> +		fprintf(stdout, "MSI-X%u:\t\t", test->msixnum);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -116,7 +116,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_WRITE, &param);
> -		fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "WRITE (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -128,7 +128,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_READ, &param);
> -		fprintf(stdout, "READ (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "READ (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -140,7 +140,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_COPY, &param);
> -		fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "COPY (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> -- 
> 2.27.0
> 
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

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

* Re: [PATCH] tools: PCI: Fix several incorrect format specifiers
  2024-11-12  9:09 [PATCH] tools: PCI: Fix several incorrect format specifiers Luo Yifan
  2024-11-15 11:30 ` Manivannan Sadhasivam
@ 2024-11-20 20:22 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2024-11-20 20:22 UTC (permalink / raw)
  To: Luo Yifan; +Cc: manivannan.sadhasivam, kw, kishon, linux-pci, linux-kernel

On Tue, Nov 12, 2024 at 05:09:24PM +0800, Luo Yifan wrote:
> Make a minor change to eliminate static checker warnings. Fix several
> incorrect format specifiers that misused signed and unsigned versions.
> 
> Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>

Applied with Mani's reviewed-by to pci/misc for v6.13, thanks!

> ---
>  tools/pci/pcitest.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
> index 470258009..7b530d838 100644
> --- a/tools/pci/pcitest.c
> +++ b/tools/pci/pcitest.c
> @@ -95,7 +95,7 @@ static int run_test(struct pci_test *test)
>  
>  	if (test->msinum > 0 && test->msinum <= 32) {
>  		ret = ioctl(fd, PCITEST_MSI, test->msinum);
> -		fprintf(stdout, "MSI%d:\t\t", test->msinum);
> +		fprintf(stdout, "MSI%u:\t\t", test->msinum);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -104,7 +104,7 @@ static int run_test(struct pci_test *test)
>  
>  	if (test->msixnum > 0 && test->msixnum <= 2048) {
>  		ret = ioctl(fd, PCITEST_MSIX, test->msixnum);
> -		fprintf(stdout, "MSI-X%d:\t\t", test->msixnum);
> +		fprintf(stdout, "MSI-X%u:\t\t", test->msixnum);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -116,7 +116,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_WRITE, &param);
> -		fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "WRITE (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -128,7 +128,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_READ, &param);
> -		fprintf(stdout, "READ (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "READ (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> @@ -140,7 +140,7 @@ static int run_test(struct pci_test *test)
>  		if (test->use_dma)
>  			param.flags = PCITEST_FLAGS_USE_DMA;
>  		ret = ioctl(fd, PCITEST_COPY, &param);
> -		fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size);
> +		fprintf(stdout, "COPY (%7lu bytes):\t\t", test->size);
>  		if (ret < 0)
>  			fprintf(stdout, "TEST FAILED\n");
>  		else
> -- 
> 2.27.0
> 
> 
> 

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

end of thread, other threads:[~2024-11-20 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12  9:09 [PATCH] tools: PCI: Fix several incorrect format specifiers Luo Yifan
2024-11-15 11:30 ` Manivannan Sadhasivam
2024-11-20 20:22 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox