diff mbox

[v2,14/22] IB/srpt: Inline trivial CM callback functions

Message ID 56ABF2BB.5060905@sandisk.com (mailing list archive)
State Superseded
Headers show

Commit Message

Bart Van Assche Jan. 29, 2016, 11:16 p.m. UTC
Inline those CM callback functions that are only two lines long.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 31 +++++++------------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

Comments

Christoph Hellwig Feb. 2, 2016, 11:06 a.m. UTC | #1
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Estrin, Alex Feb. 2, 2016, 3:34 p.m. UTC | #2
Looks good.
Reviewed-by: Alex Estrin <alex.estrin@intel.com>


> Inline those CM callback functions that are only two lines long.

> 

> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>

> Cc: Christoph Hellwig <hch@lst.de>

> Cc: Sagi Grimberg <sagig@mellanox.com>

> ---

>  drivers/infiniband/ulp/srpt/ib_srpt.c | 31 +++++++------------------------

>  1 file changed, 7 insertions(+), 24 deletions(-)

> 

> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c

> b/drivers/infiniband/ulp/srpt/ib_srpt.c

> index 652e1ef..5e4fee7 100644

> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c

> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c

> @@ -2315,18 +2315,6 @@ static void srpt_cm_rtu_recv(struct ib_cm_id *cm_id)

>  	}

>  }

> 

> -static void srpt_cm_timewait_exit(struct ib_cm_id *cm_id)

> -{

> -	pr_info("Received IB TimeWait exit for cm_id %p.\n", cm_id);

> -	srpt_drain_channel(cm_id);

> -}

> -

> -static void srpt_cm_rep_error(struct ib_cm_id *cm_id)

> -{

> -	pr_info("Received IB REP error for cm_id %p.\n", cm_id);

> -	srpt_drain_channel(cm_id);

> -}

> -

>  /**

>   * srpt_cm_dreq_recv() - Process reception of a DREQ message.

>   */

> @@ -2365,15 +2353,6 @@ static void srpt_cm_dreq_recv(struct ib_cm_id *cm_id)

>  }

> 

>  /**

> - * srpt_cm_drep_recv() - Process reception of a DREP message.

> - */

> -static void srpt_cm_drep_recv(struct ib_cm_id *cm_id)

> -{

> -	pr_info("Received InfiniBand DREP message for cm_id %p.\n", cm_id);

> -	srpt_drain_channel(cm_id);

> -}

> -

> -/**

>   * srpt_cm_handler() - IB connection manager callback function.

>   *

>   * A non-zero return value will cause the caller destroy the CM ID.

> @@ -2404,13 +2383,17 @@ static int srpt_cm_handler(struct ib_cm_id *cm_id, struct

> ib_cm_event *event)

>  		srpt_cm_dreq_recv(cm_id);

>  		break;

>  	case IB_CM_DREP_RECEIVED:

> -		srpt_cm_drep_recv(cm_id);

> +		pr_info("Received InfiniBand DREP message for cm_id %p.\n",

> +			cm_id);

> +		srpt_drain_channel(cm_id);

>  		break;

>  	case IB_CM_TIMEWAIT_EXIT:

> -		srpt_cm_timewait_exit(cm_id);

> +		pr_info("Received IB TimeWait exit for cm_id %p.\n", cm_id);

> +		srpt_drain_channel(cm_id);

>  		break;

>  	case IB_CM_REP_ERROR:

> -		srpt_cm_rep_error(cm_id);

> +		pr_info("Received IB REP error for cm_id %p.\n", cm_id);

> +		srpt_drain_channel(cm_id);

>  		break;

>  	case IB_CM_DREQ_ERROR:

>  		pr_info("Received IB DREQ ERROR event.\n");

> --

> 2.7.0
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 652e1ef..5e4fee7 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2315,18 +2315,6 @@  static void srpt_cm_rtu_recv(struct ib_cm_id *cm_id)
 	}
 }
 
-static void srpt_cm_timewait_exit(struct ib_cm_id *cm_id)
-{
-	pr_info("Received IB TimeWait exit for cm_id %p.\n", cm_id);
-	srpt_drain_channel(cm_id);
-}
-
-static void srpt_cm_rep_error(struct ib_cm_id *cm_id)
-{
-	pr_info("Received IB REP error for cm_id %p.\n", cm_id);
-	srpt_drain_channel(cm_id);
-}
-
 /**
  * srpt_cm_dreq_recv() - Process reception of a DREQ message.
  */
@@ -2365,15 +2353,6 @@  static void srpt_cm_dreq_recv(struct ib_cm_id *cm_id)
 }
 
 /**
- * srpt_cm_drep_recv() - Process reception of a DREP message.
- */
-static void srpt_cm_drep_recv(struct ib_cm_id *cm_id)
-{
-	pr_info("Received InfiniBand DREP message for cm_id %p.\n", cm_id);
-	srpt_drain_channel(cm_id);
-}
-
-/**
  * srpt_cm_handler() - IB connection manager callback function.
  *
  * A non-zero return value will cause the caller destroy the CM ID.
@@ -2404,13 +2383,17 @@  static int srpt_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
 		srpt_cm_dreq_recv(cm_id);
 		break;
 	case IB_CM_DREP_RECEIVED:
-		srpt_cm_drep_recv(cm_id);
+		pr_info("Received InfiniBand DREP message for cm_id %p.\n",
+			cm_id);
+		srpt_drain_channel(cm_id);
 		break;
 	case IB_CM_TIMEWAIT_EXIT:
-		srpt_cm_timewait_exit(cm_id);
+		pr_info("Received IB TimeWait exit for cm_id %p.\n", cm_id);
+		srpt_drain_channel(cm_id);
 		break;
 	case IB_CM_REP_ERROR:
-		srpt_cm_rep_error(cm_id);
+		pr_info("Received IB REP error for cm_id %p.\n", cm_id);
+		srpt_drain_channel(cm_id);
 		break;
 	case IB_CM_DREQ_ERROR:
 		pr_info("Received IB DREQ ERROR event.\n");