patches for DPDK stable branches
 help / color / Atom feed
From: Michael Baum <michaelba@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, viacheslavo@mellanox.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 3/6] net/mlx5: fix unnecessary init in socket handle
Date: Wed, 27 May 2020 08:37:54 +0000
Message-ID: <1590568677-11662-3-git-send-email-michaelba@mellanox.com> (raw)
In-Reply-To: <1590568677-11662-1-git-send-email-michaelba@mellanox.com>

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 <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 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


  parent reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27  8:37 [dpdk-stable] [PATCH 1/6] net/mlx5: fix hairpin Tx queue creation error flow Michael Baum
2020-05-27  8:37 ` [dpdk-stable] [PATCH 2/6] net/mlx5: fix hairpin Rx " Michael Baum
2020-05-27  8:37 ` Michael Baum [this message]
2020-05-27  8:37 ` [dpdk-stable] [PATCH 4/6] net/mlx5: fix socket handle closing Michael Baum
2020-05-27  8:37 ` [dpdk-stable] [PATCH 5/6] net/mlx5: fix needless txq initialization check Michael Baum
2020-05-27  8:37 ` [dpdk-stable] [PATCH 6/6] net/mlx5: fix compiler code arrangement in MPLS support Michael Baum
2020-05-31 11:26 ` [dpdk-stable] [dpdk-dev] [PATCH 1/6] net/mlx5: fix hairpin Tx queue creation error flow Raslan Darawsheh

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1590568677-11662-3-git-send-email-michaelba@mellanox.com \
    --to=michaelba@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox