Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
@ 2025-02-04 11:06 Niklas Cassel
  2025-02-07 18:05 ` Manivannan Sadhasivam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Niklas Cassel @ 2025-02-04 11:06 UTC (permalink / raw)
  To: bhelgaas, kw, manivannan.sadhasivam; +Cc: linux-pci, Niklas Cassel

Commit f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
changed the return value of pci_endpoint_test_bars_read_bar() from false
to -EINVAL on error, however, it failed to update the error handling.

Fixes: f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
Changes since v1:
-Changed the type of the variable ret to int to match the new return type.

 drivers/misc/pci_endpoint_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index d5ac71a49386..7584d1876859 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,
 static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
 {
 	enum pci_barno bar;
-	bool ret;
+	int ret;
 
 	/* Write all BARs in order (without reading). */
 	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
@@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
 	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
 		if (test->bar[bar]) {
 			ret = pci_endpoint_test_bars_read_bar(test, bar);
-			if (!ret)
+			if (ret)
 				return ret;
 		}
 	}
-- 
2.48.1


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

* Re: [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
  2025-02-04 11:06 [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling Niklas Cassel
@ 2025-02-07 18:05 ` Manivannan Sadhasivam
  2025-02-13 13:32 ` Niklas Cassel
  2025-02-14 17:41 ` Manivannan Sadhasivam
  2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2025-02-07 18:05 UTC (permalink / raw)
  To: Niklas Cassel; +Cc: bhelgaas, kw, linux-pci

On Tue, Feb 04, 2025 at 12:06:41PM +0100, Niklas Cassel wrote:
> Commit f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> changed the return value of pci_endpoint_test_bars_read_bar() from false
> to -EINVAL on error, however, it failed to update the error handling.
> 
> Fixes: f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> Signed-off-by: Niklas Cassel <cassel@kernel.org>

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

- Mani

> ---
> Changes since v1:
> -Changed the type of the variable ret to int to match the new return type.
> 
>  drivers/misc/pci_endpoint_test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index d5ac71a49386..7584d1876859 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,
>  static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  {
>  	enum pci_barno bar;
> -	bool ret;
> +	int ret;
>  
>  	/* Write all BARs in order (without reading). */
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
> @@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>  		if (test->bar[bar]) {
>  			ret = pci_endpoint_test_bars_read_bar(test, bar);
> -			if (!ret)
> +			if (ret)
>  				return ret;
>  		}
>  	}
> -- 
> 2.48.1
> 

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

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

* Re: [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
  2025-02-04 11:06 [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling Niklas Cassel
  2025-02-07 18:05 ` Manivannan Sadhasivam
@ 2025-02-13 13:32 ` Niklas Cassel
  2025-02-14 17:41 ` Manivannan Sadhasivam
  2 siblings, 0 replies; 4+ messages in thread
From: Niklas Cassel @ 2025-02-13 13:32 UTC (permalink / raw)
  To: bhelgaas, kw, manivannan.sadhasivam; +Cc: linux-pci

On Tue, Feb 04, 2025 at 12:06:41PM +0100, Niklas Cassel wrote:
> Commit f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> changed the return value of pci_endpoint_test_bars_read_bar() from false
> to -EINVAL on error, however, it failed to update the error handling.
> 
> Fixes: f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> ---
> Changes since v1:
> -Changed the type of the variable ret to int to match the new return type.
> 
>  drivers/misc/pci_endpoint_test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index d5ac71a49386..7584d1876859 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,
>  static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  {
>  	enum pci_barno bar;
> -	bool ret;
> +	int ret;
>  
>  	/* Write all BARs in order (without reading). */
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
> @@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>  		if (test->bar[bar]) {
>  			ret = pci_endpoint_test_bars_read_bar(test, bar);
> -			if (!ret)
> +			if (ret)
>  				return ret;
>  		}
>  	}
> -- 
> 2.48.1
> 

Ping.

Because of this bug, if this test fails, it will be reported as success,
so quite bad.


Kind regards,
Niklas

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

* Re: [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
  2025-02-04 11:06 [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling Niklas Cassel
  2025-02-07 18:05 ` Manivannan Sadhasivam
  2025-02-13 13:32 ` Niklas Cassel
@ 2025-02-14 17:41 ` Manivannan Sadhasivam
  2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2025-02-14 17:41 UTC (permalink / raw)
  To: Niklas Cassel; +Cc: bhelgaas, kw, linux-pci

On Tue, Feb 04, 2025 at 12:06:41PM +0100, Niklas Cassel wrote:
> Commit f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> changed the return value of pci_endpoint_test_bars_read_bar() from false
> to -EINVAL on error, however, it failed to update the error handling.
> 
> Fixes: f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")
> Signed-off-by: Niklas Cassel <cassel@kernel.org>

Applied to pci/endpoint!

- Mani

> ---
> Changes since v1:
> -Changed the type of the variable ret to int to match the new return type.
> 
>  drivers/misc/pci_endpoint_test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index d5ac71a49386..7584d1876859 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,
>  static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  {
>  	enum pci_barno bar;
> -	bool ret;
> +	int ret;
>  
>  	/* Write all BARs in order (without reading). */
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
> @@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>  		if (test->bar[bar]) {
>  			ret = pci_endpoint_test_bars_read_bar(test, bar);
> -			if (!ret)
> +			if (ret)
>  				return ret;
>  		}
>  	}
> -- 
> 2.48.1
> 

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

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

end of thread, other threads:[~2025-02-14 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 11:06 [PATCH v2] misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling Niklas Cassel
2025-02-07 18:05 ` Manivannan Sadhasivam
2025-02-13 13:32 ` Niklas Cassel
2025-02-14 17:41 ` Manivannan Sadhasivam

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