diff mbox series

[for-next,v2] RDMA/rxe: remove redundant err variable

Message ID 20211215075258.442930-1-chi.minghao@zte.com.cn (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series [for-next,v2] RDMA/rxe: remove redundant err variable | expand

Commit Message

CGEL Dec. 15, 2021, 7:52 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return value directly instead of taking this
in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Devesh Sharma Dec. 15, 2021, 8:40 a.m. UTC | #1
> -----Original Message-----
> From: cgel.zte@gmail.com <cgel.zte@gmail.com>
> Sent: Wednesday, December 15, 2021 1:23 PM
> To: Devesh Sharma <devesh.s.sharma@oracle.com>
> Cc: cgel.zte@gmail.com; chi.minghao@zte.com.cn; dledford@redhat.com;
> jgg@ziepe.ca; linux-kernel@vger.kernel.org; linux-rdma@vger.kernel.org;
> zealci@zte.com.cn; zyjzyj2000@gmail.com
> Subject: [External] : [PATCH for-next v2] RDMA/rxe: remove redundant err
> variable
> 
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return value directly instead of taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c
> b/drivers/infiniband/sw/rxe/rxe_net.c
> index 2cb810cb890a..f557150bd59a 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -22,24 +22,20 @@ static struct rxe_recv_sockets recv_sockets;
> 
>  int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)  {
> -	int err;
>  	unsigned char ll_addr[ETH_ALEN];
> 
>  	ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
> -	err = dev_mc_add(rxe->ndev, ll_addr);
> 
> -	return err;
> +	return dev_mc_add(rxe->ndev, ll_addr);
>  }
> 
>  int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)  {
> -	int err;
>  	unsigned char ll_addr[ETH_ALEN];
> 
>  	ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
> -	err = dev_mc_del(rxe->ndev, ll_addr);
> 
> -	return err;
> +	return dev_mc_del(rxe->ndev, ll_addr);
>  }
> 
LGTM
Reviewed-by: Devesh Sharma <Devesh.s.sharma@oracle.com>

>  static struct dst_entry *rxe_find_route4(struct net_device *ndev,
> --
> 2.25.1
Zhu Yanjun Dec. 15, 2021, 12:36 p.m. UTC | #2
On Wed, Dec 15, 2021 at 3:53 PM <cgel.zte@gmail.com> wrote:
>
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Return value directly instead of taking this
> in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>

Thanks.
Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com>

Zhu Yanjun

> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c
> b/drivers/infiniband/sw/rxe/rxe_net.c
> index 2cb810cb890a..f557150bd59a 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -22,24 +22,20 @@ static struct rxe_recv_sockets recv_sockets;
>
>  int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
>  {
> -       int err;
>         unsigned char ll_addr[ETH_ALEN];
>
>         ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
> -       err = dev_mc_add(rxe->ndev, ll_addr);
>
> -       return err;
> +       return dev_mc_add(rxe->ndev, ll_addr);
>  }
>
>  int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)
>  {
> -       int err;
>         unsigned char ll_addr[ETH_ALEN];
>
>         ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
> -       err = dev_mc_del(rxe->ndev, ll_addr);
>
> -       return err;
> +       return dev_mc_del(rxe->ndev, ll_addr);
>  }
>
>  static struct dst_entry *rxe_find_route4(struct net_device *ndev,
> --
> 2.25.1
>
Jason Gunthorpe Jan. 5, 2022, 5:54 p.m. UTC | #3
On Wed, Dec 15, 2021 at 07:52:58AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return value directly instead of taking this
> in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c
b/drivers/infiniband/sw/rxe/rxe_net.c
index 2cb810cb890a..f557150bd59a 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -22,24 +22,20 @@  static struct rxe_recv_sockets recv_sockets;
 
 int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
 {
-	int err;
 	unsigned char ll_addr[ETH_ALEN];
 
 	ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
-	err = dev_mc_add(rxe->ndev, ll_addr);
 
-	return err;
+	return dev_mc_add(rxe->ndev, ll_addr);
 }
 
 int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)
 {
-	int err;
 	unsigned char ll_addr[ETH_ALEN];
 
 	ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
-	err = dev_mc_del(rxe->ndev, ll_addr);
 
-	return err;
+	return dev_mc_del(rxe->ndev, ll_addr);
 }
 
 static struct dst_entry *rxe_find_route4(struct net_device *ndev,