diff mbox

[1/1] IB/rxe: change rxe_set_mtu function type to void

Message ID 1524234654-14199-1-git-send-email-yanjun.zhu@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zhu Yanjun April 20, 2018, 2:30 p.m. UTC
The function rxe_set_mtu always returns zero. So this function type
is changed to void.

CC: Srinivas Eeda <srinivas.eeda@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe.c | 8 ++------
 drivers/infiniband/sw/rxe/rxe.h | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

Comments

Yuval Shaia April 21, 2018, 5:41 p.m. UTC | #1
On Fri, Apr 20, 2018 at 10:30:54AM -0400, Zhu Yanjun wrote:
> The function rxe_set_mtu always returns zero. So this function type
> is changed to void.
> 
> CC: Srinivas Eeda <srinivas.eeda@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

> ---
>  drivers/infiniband/sw/rxe/rxe.c | 8 ++------
>  drivers/infiniband/sw/rxe/rxe.h | 2 +-
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
> index e493fdb..59ee813 100644
> --- a/drivers/infiniband/sw/rxe/rxe.c
> +++ b/drivers/infiniband/sw/rxe/rxe.c
> @@ -291,7 +291,7 @@ static int rxe_init(struct rxe_dev *rxe)
>  	return err;
>  }
>  
> -int rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
> +void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
>  {
>  	struct rxe_port *port = &rxe->port;
>  	enum ib_mtu mtu;
> @@ -303,8 +303,6 @@ int rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
>  
>  	port->attr.active_mtu = mtu;
>  	port->mtu_cap = ib_mtu_enum_to_int(mtu);
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL(rxe_set_mtu);
>  
> @@ -321,9 +319,7 @@ int rxe_add(struct rxe_dev *rxe, unsigned int mtu)
>  	if (err)
>  		goto err1;
>  
> -	err = rxe_set_mtu(rxe, mtu);
> -	if (err)
> -		goto err1;
> +	rxe_set_mtu(rxe, mtu);
>  
>  	err = rxe_register_device(rxe);
>  	if (err)
> diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
> index 561ad30..d831aeb 100644
> --- a/drivers/infiniband/sw/rxe/rxe.h
> +++ b/drivers/infiniband/sw/rxe/rxe.h
> @@ -92,7 +92,7 @@ static inline u32 rxe_crc32(struct rxe_dev *rxe,
>  	return retval;
>  }
>  
> -int rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
> +void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
>  
>  int rxe_add(struct rxe_dev *rxe, unsigned int mtu);
>  void rxe_remove(struct rxe_dev *rxe);
> -- 
> 2.7.4
> 
> --
> 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
--
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
Doug Ledford April 27, 2018, 4:21 p.m. UTC | #2
On Fri, 2018-04-20 at 10:30 -0400, Zhu Yanjun wrote:
> The function rxe_set_mtu always returns zero. So this function type
> is changed to void.
> 
> CC: Srinivas Eeda <srinivas.eeda@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>

Thanks, applied to for-next.
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
index e493fdb..59ee813 100644
--- a/drivers/infiniband/sw/rxe/rxe.c
+++ b/drivers/infiniband/sw/rxe/rxe.c
@@ -291,7 +291,7 @@  static int rxe_init(struct rxe_dev *rxe)
 	return err;
 }
 
-int rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
+void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
 {
 	struct rxe_port *port = &rxe->port;
 	enum ib_mtu mtu;
@@ -303,8 +303,6 @@  int rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
 
 	port->attr.active_mtu = mtu;
 	port->mtu_cap = ib_mtu_enum_to_int(mtu);
-
-	return 0;
 }
 EXPORT_SYMBOL(rxe_set_mtu);
 
@@ -321,9 +319,7 @@  int rxe_add(struct rxe_dev *rxe, unsigned int mtu)
 	if (err)
 		goto err1;
 
-	err = rxe_set_mtu(rxe, mtu);
-	if (err)
-		goto err1;
+	rxe_set_mtu(rxe, mtu);
 
 	err = rxe_register_device(rxe);
 	if (err)
diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
index 561ad30..d831aeb 100644
--- a/drivers/infiniband/sw/rxe/rxe.h
+++ b/drivers/infiniband/sw/rxe/rxe.h
@@ -92,7 +92,7 @@  static inline u32 rxe_crc32(struct rxe_dev *rxe,
 	return retval;
 }
 
-int rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
+void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
 
 int rxe_add(struct rxe_dev *rxe, unsigned int mtu);
 void rxe_remove(struct rxe_dev *rxe);