linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative
@ 2020-10-26  9:12 Zhang Qilong
  2020-10-27  2:03 ` Martin K. Petersen
  2020-10-27  8:52 ` John Garry
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Qilong @ 2020-10-26  9:12 UTC (permalink / raw)
  To: hare, jejb, martin.petersen; +Cc: linux-scsi

A negative error code should be returned
instead of a positive one when going to
error path.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/scsi/aic7xxx/aic79xx_pci.c | 2 +-
 drivers/scsi/aic7xxx/aic7xxx_pci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c
index 8397ae93f7dd..0edce0ebd944 100644
--- a/drivers/scsi/aic7xxx/aic79xx_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_pci.c
@@ -419,7 +419,7 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
 	int	 error;
 	uint8_t	 hcntrl;
 
-	error = EIO;
+	error = -EIO;
 
 	/*
 	 * Enable PCI error interrupt status, but suppress NMIs
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
index 656f680c7802..cbeca694e883 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
@@ -1168,7 +1168,7 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
 	uint32_t cmd;
 	uint8_t	 hcntrl;
 
-	error = EIO;
+	error = -EIO;
 
 	/*
 	 * Enable PCI error interrupt status, but suppress NMIs
-- 
2.17.1


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

* Re: [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative
  2020-10-26  9:12 [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative Zhang Qilong
@ 2020-10-27  2:03 ` Martin K. Petersen
  2020-10-27  8:52 ` John Garry
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-10-27  2:03 UTC (permalink / raw)
  To: Zhang Qilong; +Cc: hare, jejb, martin.petersen, linux-scsi


Zhang,

> A negative error code should be returned instead of a positive one
> when going to error path.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative
  2020-10-26  9:12 [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative Zhang Qilong
  2020-10-27  2:03 ` Martin K. Petersen
@ 2020-10-27  8:52 ` John Garry
  1 sibling, 0 replies; 3+ messages in thread
From: John Garry @ 2020-10-27  8:52 UTC (permalink / raw)
  To: Zhang Qilong, hare, jejb, martin.petersen; +Cc: linux-scsi

On 26/10/2020 09:12, Zhang Qilong wrote:
> A negative error code should be returned
> instead of a positive one when going to
> error path.

There's many other places in this driver which still use positive error 
codes, so now inconsistent. I didn't see a good reason to change.

> 
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
>   drivers/scsi/aic7xxx/aic79xx_pci.c | 2 +-
>   drivers/scsi/aic7xxx/aic7xxx_pci.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c
> index 8397ae93f7dd..0edce0ebd944 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_pci.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c
> @@ -419,7 +419,7 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
>   	int	 error;
>   	uint8_t	 hcntrl;
>   
> -	error = EIO;
> +	error = -EIO;
>   
>   	/*
>   	 * Enable PCI error interrupt status, but suppress NMIs
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
> index 656f680c7802..cbeca694e883 100644
> --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
> +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
> @@ -1168,7 +1168,7 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
>   	uint32_t cmd;
>   	uint8_t	 hcntrl;
>   
> -	error = EIO;
> +	error = -EIO;
>   
>   	/*
>   	 * Enable PCI error interrupt status, but suppress NMIs
> 


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

end of thread, other threads:[~2020-10-27  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26  9:12 [PATCH -next] [SCSI] aic7xxx: change the error value of ahx_pci_test_register_access from postive to negative Zhang Qilong
2020-10-27  2:03 ` Martin K. Petersen
2020-10-27  8:52 ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).