]> www.infradead.org Git - users/hch/block.git/commitdiff
scsi: aic7xxx: aic79xx: Return negative error when register access fails
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 26 Oct 2020 09:12:36 +0000 (17:12 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 27 Oct 2020 02:02:53 +0000 (22:02 -0400)
A negative error code should be returned in the error path instead of a
positive one.

Link: https://lore.kernel.org/r/20201026091236.68561-1-zhangqilong3@huawei.com
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aic7xxx/aic79xx_pci.c
drivers/scsi/aic7xxx/aic7xxx_pci.c

index 8397ae93f7dd9352344ffd09e4663c4fc6c6b91f..0edce0ebd94452c442d63208b4239fc74e0166dd 100644 (file)
@@ -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
index 656f680c78024d7cd64a357b7056ba538d89262c..cbeca694e8838126c2464520875a84b05d702d89 100644 (file)
@@ -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