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=202502 header.b=XkZqw84o; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id E10A35A9C3C for ; Wed, 05 Mar 2025 07:15:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1741155310; bh=wdKa0snFMQOc6TutwvnqVJSdO7WZUZfNQai2NecTYuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XkZqw84oBhxXu9uRrzq4dLLoP0XaV60fPruewhvi3bFFS2KAoAZ5PAQ4FMzwxedWZ 4J6GtKfhpTWluxO0z0Mln1OwTLw9mb+ujMptsiMlFnAhJRB5e5hJ13H1e1CBP7D0Ji 5yjS8GBxwYeiE7tK+4U9N4Zptm3FIacG4+zWzJm/6dcbzNfow5sU//TseMzLo0tr64 jIXLlGLGCIIzGgWTs6hWYxuWS3NncHL0hkeehuFE+yG6RypUAyhGnovUPw5YIFJwH4 HwwcN9Wr3CKNRtoKaQBHBu39vLe/NJ3RURPj+0mnuK2f4YfNdtg+goM+NqScuzQ+YN bOI2WkvakDSfA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Z72My3JJnz4x5k; Wed, 5 Mar 2025 17:15:10 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 1/6] treewide: Mark assorted functions static Date: Wed, 5 Mar 2025 17:15:03 +1100 Message-ID: <20250305061508.1699713-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250305061508.1699713-1-david@gibson.dropbear.id.au> References: <20250305061508.1699713-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ZTFC7I6UZ4KHV23TWUIZPTLNM5ERVFLC X-Message-ID-Hash: ZTFC7I6UZ4KHV23TWUIZPTLNM5ERVFLC 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 , 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: From: David Gibson This marks static a number of functions which are only used in their .c file, have no prototypes in a .h and were never intended to be globally exposed. Signed-off-by: David Gibson --- log.c | 2 +- netlink.c | 2 +- passt.c | 2 +- tcp.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/log.c b/log.c index 95e45762..b6bce214 100644 --- a/log.c +++ b/log.c @@ -56,7 +56,7 @@ bool log_stderr = true; /* Not daemonised, no shell spawned */ * * Return: pointer to @now, or NULL if there was an error retrieving the time */ -const struct timespec *logtime(struct timespec *ts) +static const struct timespec *logtime(struct timespec *ts) { if (clock_gettime(CLOCK_MONOTONIC, ts)) return NULL; diff --git a/netlink.c b/netlink.c index 37d8b5bc..a0525047 100644 --- a/netlink.c +++ b/netlink.c @@ -355,7 +355,7 @@ unsigned int nl_get_ext_if(int s, sa_family_t af) * * Return: true if a gateway was found, false otherwise */ -bool nl_route_get_def_multipath(struct rtattr *rta, void *gw) +static bool nl_route_get_def_multipath(struct rtattr *rta, void *gw) { int nh_len = RTA_PAYLOAD(rta); struct rtnexthop *rtnh; diff --git a/passt.c b/passt.c index 68d1a283..868842b0 100644 --- a/passt.c +++ b/passt.c @@ -166,7 +166,7 @@ void proto_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s) * * #syscalls exit_group */ -void exit_handler(int signal) +static void exit_handler(int signal) { (void)signal; diff --git a/tcp.c b/tcp.c index b3aa9a2c..1db16095 100644 --- a/tcp.c +++ b/tcp.c @@ -2427,7 +2427,7 @@ static void tcp_ns_sock_init6(const struct ctx *c, in_port_t port) * @c: Execution context * @port: Port, host order */ -void tcp_ns_sock_init(const struct ctx *c, in_port_t port) +static void tcp_ns_sock_init(const struct ctx *c, in_port_t port) { ASSERT(!c->no_tcp); @@ -3071,7 +3071,7 @@ static int tcp_flow_dump_rcvqueue(int s, struct tcp_tap_transfer_ext *t) * * Return: 0 on success, negative error code on failure */ -int tcp_flow_repair_opt(int s, const struct tcp_tap_transfer_ext *t) +static int tcp_flow_repair_opt(int s, const struct tcp_tap_transfer_ext *t) { const struct tcp_repair_opt opts[] = { { TCPOPT_WINDOW, t->snd_ws + (t->rcv_ws << 16) }, @@ -3263,7 +3263,7 @@ fail: * * Return: 0 on success, negative error code on failure */ -int tcp_flow_repair_socket(struct ctx *c, struct tcp_tap_conn *conn) +static int tcp_flow_repair_socket(struct ctx *c, struct tcp_tap_conn *conn) { sa_family_t af = CONN_V4(conn) ? AF_INET : AF_INET6; const struct flowside *sockside = HOSTFLOW(conn); -- 2.48.1