diff mbox

[09/14] RDMA/cxgb4: Use common error handling code in recover_lost_dbs()

Message ID 3da7cff6-9f94-2ae8-a173-7ad6efdb524b@users.sourceforge.net (mailing list archive)
State Rejected
Headers show

Commit Message

SF Markus Elfring Feb. 8, 2017, 9:19 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 8 Feb 2017 18:08:08 +0100

Add a jump target so that a bit of exception handling can be better reused
from an in branch in this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/infiniband/hw/cxgb4/device.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Leon Romanovsky Feb. 9, 2017, 6:57 p.m. UTC | #1
On Wed, Feb 08, 2017 at 10:19:41PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 8 Feb 2017 18:08:08 +0100
>
> Add a jump target so that a bit of exception handling can be better reused
> from an in branch in this function.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/cxgb4/device.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index 2931920d7c4c..86cf7026619f 100644
> --- a/drivers/infiniband/hw/cxgb4/device.c
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -1402,9 +1402,7 @@ static void recover_lost_dbs(struct uld_ctx *ctx, struct qp_list *qp_list)
>  			       pci_name(ctx->lldi.pdev),
>  			       ": Fatal error - DB overflow recovery failed - error syncing ",
>  			       qp->wq.sq.qid);
> -			spin_unlock(&qp->lock);
> -			spin_unlock_irq(&qp->rhp->lock);
> -			return;
> +			goto unlock;
>  		}
>  		qp->wq.sq.wq_pidx_inc = 0;
>
> @@ -1418,6 +1416,7 @@ static void recover_lost_dbs(struct uld_ctx *ctx, struct qp_list *qp_list)
>  			       pci_name(ctx->lldi.pdev),
>  			       ": Fatal error - DB overflow recovery failed - error syncing ",
>  			       qp->wq.rq.qid);
> +unlock:
>  			spin_unlock(&qp->lock);
>  			spin_unlock_irq(&qp->rhp->lock);
>  			return;


These patches are completely insane.
Goto label in the middle of the loop, just to exit from it.

> --
> 2.11.1
>
diff mbox

Patch

diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 2931920d7c4c..86cf7026619f 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -1402,9 +1402,7 @@  static void recover_lost_dbs(struct uld_ctx *ctx, struct qp_list *qp_list)
 			       pci_name(ctx->lldi.pdev),
 			       ": Fatal error - DB overflow recovery failed - error syncing ",
 			       qp->wq.sq.qid);
-			spin_unlock(&qp->lock);
-			spin_unlock_irq(&qp->rhp->lock);
-			return;
+			goto unlock;
 		}
 		qp->wq.sq.wq_pidx_inc = 0;
 
@@ -1418,6 +1416,7 @@  static void recover_lost_dbs(struct uld_ctx *ctx, struct qp_list *qp_list)
 			       pci_name(ctx->lldi.pdev),
 			       ": Fatal error - DB overflow recovery failed - error syncing ",
 			       qp->wq.rq.qid);
+unlock:
 			spin_unlock(&qp->lock);
 			spin_unlock_irq(&qp->rhp->lock);
 			return;