diff mbox

lpfc: Remove redundant code block in lpfc_scsi_cmd_iocb_cmpl

Message ID 1453302520-10499-1-git-send-email-jthumshirn@suse.de (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Johannes Thumshirn Jan. 20, 2016, 3:08 p.m. UTC
This removes a redundant code block that will either be executed if the
ENABLE_FCP_RING_POLLING flag is set in phba->cfg_poll or not. The code is just
duplicated in both cases, hence we unify it again.

This probably is a left over from some sort of refactoring.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 17 -----------------
 1 file changed, 17 deletions(-)

Comments

Tomas Henzl Jan. 20, 2016, 4:01 p.m. UTC | #1
On 20.1.2016 16:08, Johannes Thumshirn wrote:
> This removes a redundant code block that will either be executed if the
> ENABLE_FCP_RING_POLLING flag is set in phba->cfg_poll or not. The code is just
> duplicated in both cases, hence we unify it again.
>
> This probably is a left over from some sort of refactoring.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas

> ---
>  drivers/scsi/lpfc/lpfc_scsi.c | 17 -----------------
>  1 file changed, 17 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
> index 152b3c8..3bd0be6 100644
> --- a/drivers/scsi/lpfc/lpfc_scsi.c
> +++ b/drivers/scsi/lpfc/lpfc_scsi.c
> @@ -4139,23 +4139,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
>  	/* The sdev is not guaranteed to be valid post scsi_done upcall. */
>  	cmd->scsi_done(cmd);
>  
> -	if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
> -		spin_lock_irqsave(&phba->hbalock, flags);
> -		lpfc_cmd->pCmd = NULL;
> -		spin_unlock_irqrestore(&phba->hbalock, flags);
> -
> -		/*
> -		 * If there is a thread waiting for command completion
> -		 * wake up the thread.
> -		 */
> -		spin_lock_irqsave(shost->host_lock, flags);
> -		if (lpfc_cmd->waitq)
> -			wake_up(lpfc_cmd->waitq);
> -		spin_unlock_irqrestore(shost->host_lock, flags);
> -		lpfc_release_scsi_buf(phba, lpfc_cmd);
> -		return;
> -	}
> -
>  	spin_lock_irqsave(&phba->hbalock, flags);
>  	lpfc_cmd->pCmd = NULL;
>  	spin_unlock_irqrestore(&phba->hbalock, flags);

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matthew R. Ochs Jan. 20, 2016, 4:19 p.m. UTC | #2
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> 

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sebastian Herbszt Jan. 20, 2016, 9:52 p.m. UTC | #3
Johannes Thumshirn wrote:
> This removes a redundant code block that will either be executed if the
> ENABLE_FCP_RING_POLLING flag is set in phba->cfg_poll or not. The code is just
> duplicated in both cases, hence we unify it again.
> 
> This probably is a left over from some sort of refactoring.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>

Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Jan. 27, 2016, 2:33 a.m. UTC | #4
>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> This removes a redundant code block that will either be
Johannes> executed if the ENABLE_FCP_RING_POLLING flag is set in
Johannes> phba->cfg_poll or not. The code is just duplicated in both
Johannes> cases, hence we unify it again.

Johannes> This probably is a left over from some sort of refactoring.

James/Dick: Please review.
Martin K. Petersen Feb. 10, 2016, 5:37 p.m. UTC | #5
>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> This removes a redundant code block that will either be
Johannes> executed if the ENABLE_FCP_RING_POLLING flag is set in
Johannes> phba->cfg_poll or not. The code is just duplicated in both
Johannes> cases, hence we unify it again.

James and Dick: Ping!

https://patchwork.kernel.org/patch/8072451/
Martin K. Petersen Feb. 11, 2016, 12:15 a.m. UTC | #6
>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> This removes a redundant code block that will either be
Johannes> executed if the ENABLE_FCP_RING_POLLING flag is set in
Johannes> phba->cfg_poll or not. The code is just duplicated in both
Johannes> cases, hence we unify it again.

Johannes> This probably is a left over from some sort of refactoring.

Applied to 4.6/scsi-queue.
Johannes Thumshirn Feb. 11, 2016, 11:35 a.m. UTC | #7
On Wed, Feb 10, 2016 at 01:32:50PM -0500, Dick Kennedy wrote:
> Martin, 
> the FCP_RING_POLLING feature is an old driver option that we would like to
> remove from the driver. It was put in in 2006 as a feature request.
> What we don't know is if any customers still use it? or ever used it. 
> 
> The patch looks fine. 
> ACK

Dick, is there any chance you could Ack my lockdep assertion patch as well?
Bart seemed to like it and I think our support people will do as well as it
screams pretty loud when something isn't golden there.

TIA,
	Johannes

> 
> On Wed, Feb 10, 2016 at 12:37 PM, Martin K. Petersen <
> martin.petersen@oracle.com> wrote:
> 
>     >>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:
> 
>     Johannes> This removes a redundant code block that will either be
>     Johannes> executed if the ENABLE_FCP_RING_POLLING flag is set in
>     Johannes> phba->cfg_poll or not. The code is just duplicated in both
>     Johannes> cases, hence we unify it again.
> 
>     James and Dick: Ping!
> 
>     https://patchwork.kernel.org/patch/8072451/
>    
>     --
>     Martin K. Petersen      Oracle Linux Engineering
> 
>
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 152b3c8..3bd0be6 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -4139,23 +4139,6 @@  lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
 	/* The sdev is not guaranteed to be valid post scsi_done upcall. */
 	cmd->scsi_done(cmd);
 
-	if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
-		spin_lock_irqsave(&phba->hbalock, flags);
-		lpfc_cmd->pCmd = NULL;
-		spin_unlock_irqrestore(&phba->hbalock, flags);
-
-		/*
-		 * If there is a thread waiting for command completion
-		 * wake up the thread.
-		 */
-		spin_lock_irqsave(shost->host_lock, flags);
-		if (lpfc_cmd->waitq)
-			wake_up(lpfc_cmd->waitq);
-		spin_unlock_irqrestore(shost->host_lock, flags);
-		lpfc_release_scsi_buf(phba, lpfc_cmd);
-		return;
-	}
-
 	spin_lock_irqsave(&phba->hbalock, flags);
 	lpfc_cmd->pCmd = NULL;
 	spin_unlock_irqrestore(&phba->hbalock, flags);