RE: [External] : [PATCH for-next v2] RDMA/rxe: remove redundant err variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: cgel.zte@xxxxxxxxx <cgel.zte@xxxxxxxxx>
> Sent: Wednesday, December 15, 2021 1:23 PM
> To: Devesh Sharma <devesh.s.sharma@xxxxxxxxxx>
> Cc: cgel.zte@xxxxxxxxx; chi.minghao@xxxxxxxxxx; dledford@xxxxxxxxxx;
> jgg@xxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx;
> zealci@xxxxxxxxxx; zyjzyj2000@xxxxxxxxx
> Subject: [External] : [PATCH for-next v2] RDMA/rxe: remove redundant err
> variable
> 
> From: Minghao Chi <chi.minghao@xxxxxxxxxx>
> 
> Return value directly instead of taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
> Signed-off-by: Minghao Chi <chi.minghao@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

>  static struct dst_entry *rxe_find_route4(struct net_device *ndev,
> --
> 2.25.1





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux