From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202408 header.b=TAsXIxcc; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 926A25A004F for ; Mon, 26 Aug 2024 11:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202408; t=1724665039; bh=bp+Dzq1JWEf3YvMpWI3UqY5ujU9cNVVRY/hmGs3DyqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TAsXIxccQUS36x7zDDwp76rH3Wk+sNsoAmQVjbG4RYB+CeTwjvudPmx0uF3FHEjLM r3bmY2kwjlLB87o5IpweqU+lYnIicsjWyDYcY/JcV/k9TG97i43C4FQNUTGj9gFg30 ozJTQgkRm8n4YYAuhFOb559ebNd7tlY5HKhaq0EIb4d/d2aXPDnZeoBDTMLFm2WqXJ ii1YXWmbEFhGriOxby78NhXie8utacOVAn0rRBytbYeP2D5ysJCMKdzl3D0B+umOaC qUSw68chYr+S6xARBOubZaX7RGXui0Pu70P70Oo6Il0EMf3kn4+uhB5WpsD7LwuGEj yc3oUhxe2uKTQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WslvM3L7Jz4x3J; Mon, 26 Aug 2024 19:37:19 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 2/3] udp: Remove unnnecessary local from udp_sock_init() Date: Mon, 26 Aug 2024 19:37:15 +1000 Message-ID: <20240826093716.1925064-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240826093716.1925064-1-david@gibson.dropbear.id.au> References: <20240826093716.1925064-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: HFC2PC7XWUURUEA5HDOU7D3ICIVDMX7Z X-Message-ID-Hash: HFC2PC7XWUURUEA5HDOU7D3ICIVDMX7Z X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The 's' variable is always redundant with either 'r4' or 'r6', so remove it. Signed-off-by: David Gibson --- udp.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/udp.c b/udp.c index 6638c22b..a2e7043a 100644 --- a/udp.c +++ b/udp.c @@ -717,7 +717,7 @@ int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, const void *addr, const char *ifname, in_port_t port) { union udp_listen_epoll_ref uref = { .port = port }; - int s, r4 = FD_REF_MAX + 1, r6 = FD_REF_MAX + 1; + int r4 = FD_REF_MAX + 1, r6 = FD_REF_MAX + 1; ASSERT(!c->no_udp); @@ -728,29 +728,29 @@ int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, if ((af == AF_INET || af == AF_UNSPEC) && c->ifi4) { if (!ns) { - r4 = s = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, - addr, ifname, port, uref.u32); + r4 = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, + addr, ifname, port, uref.u32); - udp_splice_init[V4][port] = s < 0 ? -1 : s; + udp_splice_init[V4][port] = r4 < 0 ? -1 : r4; } else { - r4 = s = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, - &in4addr_loopback, - ifname, port, uref.u32); - udp_splice_ns[V4][port] = s < 0 ? -1 : s; + r4 = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, + &in4addr_loopback, + ifname, port, uref.u32); + udp_splice_ns[V4][port] = r4 < 0 ? -1 : r4; } } if ((af == AF_INET6 || af == AF_UNSPEC) && c->ifi6) { if (!ns) { - r6 = s = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, - addr, ifname, port, uref.u32); + r6 = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, + addr, ifname, port, uref.u32); - udp_splice_init[V6][port] = s < 0 ? -1 : s; + udp_splice_init[V6][port] = r6 < 0 ? -1 : r6; } else { - r6 = s = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, - &in6addr_loopback, - ifname, port, uref.u32); - udp_splice_ns[V6][port] = s < 0 ? -1 : s; + r6 = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, + &in6addr_loopback, + ifname, port, uref.u32); + udp_splice_ns[V6][port] = r6 < 0 ? -1 : r6; } } -- 2.46.0