Re: [EXT] [PATCH] qla2xxx: Fix sparse warnings triggered by the PCI state checking code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 12/18/19, 6:44 PM, "Bart Van Assche" <bvanassche@xxxxxxx> wrote:

    External Email
    
    ----------------------------------------------------------------------
    This patch fixes the following sparse warnings:
    
    drivers/scsi/qla2xxx/qla_mbx.c:120:21: warning: restricted pci_channel_state_t degrades to integer
    drivers/scsi/qla2xxx/qla_mbx.c:120:37: warning: restricted pci_channel_state_t degrades to integer
    
    This patch does not change any functionality. From include/linux/pci.h:
    
    enum pci_channel_state {
    	/* I/O channel is in normal state */
    	pci_channel_io_normal = (__force pci_channel_state_t) 1,
    
    	/* I/O to channel is blocked */
    	pci_channel_io_frozen = (__force pci_channel_state_t) 2,
    
    	/* PCI card is dead */
    	pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
    };
    
    Cc: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
    Cc: Quinn Tran <qutran@xxxxxxxxxxx>
    Cc: Martin Wilck <mwilck@xxxxxxxx>
    Cc: Daniel Wagner <dwagner@xxxxxxx>
    Cc: Roman Bolshakov <r.bolshakov@xxxxxxxxx>
    Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
    ---
     drivers/scsi/qla2xxx/qla_mbx.c | 5 ++---
     drivers/scsi/qla2xxx/qla_mr.c  | 5 ++---
     2 files changed, 4 insertions(+), 6 deletions(-)
    
    diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
    index b7c1108c48e2..935af77e519f 100644
    --- a/drivers/scsi/qla2xxx/qla_mbx.c
    +++ b/drivers/scsi/qla2xxx/qla_mbx.c
    @@ -117,10 +117,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
     
     	ql_dbg(ql_dbg_mbx, vha, 0x1000, "Entered %s.\n", __func__);
     
    -	if (ha->pdev->error_state > pci_channel_io_frozen) {
    +	if (ha->pdev->error_state == pci_channel_io_perm_failure) {
     		ql_log(ql_log_warn, vha, 0x1001,
    -		    "error_state is greater than pci_channel_io_frozen, "
    -		    "exiting.\n");
    +		    "PCI channel failed permanently, exiting.\n");
     		return QLA_FUNCTION_TIMEOUT;
     	}
     
    diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
    index 605b59c76c90..5f7efdb0cce7 100644
    --- a/drivers/scsi/qla2xxx/qla_mr.c
    +++ b/drivers/scsi/qla2xxx/qla_mr.c
    @@ -53,10 +53,9 @@ qlafx00_mailbox_command(scsi_qla_host_t *vha, struct mbx_cmd_32 *mcp)
     	struct qla_hw_data *ha = vha->hw;
     	scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
     
    -	if (ha->pdev->error_state > pci_channel_io_frozen) {
    +	if (ha->pdev->error_state == pci_channel_io_perm_failure) {
     		ql_log(ql_log_warn, vha, 0x115c,
    -		    "error_state is greater than pci_channel_io_frozen, "
    -		    "exiting.\n");
    +		    "PCI channel failed permanently, exiting.\n");
     		return QLA_FUNCTION_TIMEOUT;
     	}
     
Looks Good. 

Acked-by: Himanshu Madhani <hmadhani@xxxxxxxxxxx>






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux