From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C1E3A04A4 for ; Wed, 27 May 2020 10:38:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF5041D8DD; Wed, 27 May 2020 10:38:54 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 224F51D8D5 for ; Wed, 27 May 2020 10:38:52 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from matan@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 May 2020 11:38:48 +0300 Received: from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 04R8cgsu005678; Wed, 27 May 2020 11:38:48 +0300 From: Michael Baum To: dev@dpdk.org Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org Date: Wed, 27 May 2020 08:37:54 +0000 Message-Id: <1590568677-11662-3-git-send-email-michaelba@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1590568677-11662-1-git-send-email-michaelba@mellanox.com> References: <1590568677-11662-1-git-send-email-michaelba@mellanox.com> Subject: [dpdk-stable] [PATCH 3/6] net/mlx5: fix unnecessary init in socket handle X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" In the mlx5_pmd_socket_handle function it calls the recvmsg function which returns the number of bytes read. The function assigns this return value into a ret variable defined at the beginning of the function. Similarly in the mlx5_pmd_socket_init function the it calls the socket function which returns a file descriptor for the new socket. The function also assigns this return value into a ret variable defined at the beginning of the function. In both functions they initialize the variable when defining it, however, in both cases they do not use any ret variable before assigning the return value from the function, so the initialization is unnecessary. Clean the aforementioned unnecessary initializations. Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c index a79896c..f473795 100644 --- a/drivers/net/mlx5/mlx5_socket.c +++ b/drivers/net/mlx5/mlx5_socket.c @@ -37,7 +37,7 @@ mlx5_pmd_socket_handle(void *cb __rte_unused) { int conn_sock; - int ret = -1; + int ret; struct cmsghdr *cmsg = NULL; int data; char buf[CMSG_SPACE(sizeof(int))] = { 0 }; @@ -163,7 +163,7 @@ struct sockaddr_un sun = { .sun_family = AF_UNIX, }; - int ret = -1; + int ret; int flags; MLX5_ASSERT(rte_eal_process_type() == RTE_PROC_PRIMARY); -- 1.8.3.1