diff mbox series

scsi: lpfc: Remove unneeded return variable

Message ID 1612424125-91111-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series scsi: lpfc: Remove unneeded return variable | expand

Commit Message

Yang Li Feb. 4, 2021, 7:35 a.m. UTC
This patch removes unneeded return variables, using only
'1' instead.
It fixes the following warning detected by coccinelle:

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Thumshirn Feb. 4, 2021, 9:48 a.m. UTC | #1
On 04/02/2021 08:37, Yang Li wrote:
> This patch removes unneeded return variables, using only
> '1' instead.
> It fixes the following warning detected by coccinelle:
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/scsi/lpfc/lpfc_sli.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 95caad7..31f97f6 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -3376,7 +3376,6 @@ struct lpfc_hbq_init *lpfc_hbq_defs[] = {
>  			  struct lpfc_iocbq *saveq)
>  {
>  	struct lpfc_iocbq *cmdiocbp;
> -	int rc = 1;
>  	unsigned long iflag;
>  
>  	cmdiocbp = lpfc_sli_iocbq_lookup(phba, pring, saveq);
> @@ -3501,7 +3500,7 @@ struct lpfc_hbq_init *lpfc_hbq_defs[] = {
>  		}
>  	}
>  
> -	return rc;
> +	return 1;
>  }
>  
>  /**
> 

I suppose this is in 'lpfc_sli_process_sol_iocb()'. It's return 
value doesn't get handled either:

                case LPFC_SOL_IOCB:                                              
                        spin_unlock_irqrestore(&phba->hbalock, iflag);           
                        rc = lpfc_sli_process_sol_iocb(phba, pring, saveq);      
                        spin_lock_irqsave(&phba->hbalock, iflag);                
                        break;                                                   
[...]                                                       
                }                                                                
                                                                                 
                if (free_saveq) {                                                
                        list_for_each_entry_safe(rspiocbp, next_iocb,            
                                                 &saveq->list, list) {           
                                list_del_init(&rspiocbp->list);                  
                                __lpfc_sli_release_iocbq(phba, rspiocbp);        
                        }                                                        
                        __lpfc_sli_release_iocbq(phba, saveq);                   
                }                                                                
                rspiocbp = NULL;                                                 
        }                                                                        
        spin_unlock_irqrestore(&phba->hbalock, iflag);                           
        return rspiocbp;
}
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 95caad7..31f97f6 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -3376,7 +3376,6 @@  struct lpfc_hbq_init *lpfc_hbq_defs[] = {
 			  struct lpfc_iocbq *saveq)
 {
 	struct lpfc_iocbq *cmdiocbp;
-	int rc = 1;
 	unsigned long iflag;
 
 	cmdiocbp = lpfc_sli_iocbq_lookup(phba, pring, saveq);
@@ -3501,7 +3500,7 @@  struct lpfc_hbq_init *lpfc_hbq_defs[] = {
 		}
 	}
 
-	return rc;
+	return 1;
 }
 
 /**