From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 7/8] treewide: Make some additional variables static
Date: Mon, 11 May 2026 20:03:21 +1000 [thread overview]
Message-ID: <20260511100322.1016757-8-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260511100322.1016757-1-david@gibson.dropbear.id.au>
Mark a number of extra variables local to a single module as static.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
conf.c | 2 +-
log.c | 2 +-
tcp.c | 6 +++---
tcp_buf.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/conf.c b/conf.c
index 8acf66cc..029b9c7c 100644
--- a/conf.c
+++ b/conf.c
@@ -67,7 +67,7 @@
{{{ 0xfe, 0x80, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0x01 }}}
-const char *pasta_default_ifn = "tap0";
+static const char *pasta_default_ifn = "tap0";
/**
* add_dns4() - Possibly add the IPv4 address of a DNS resolver to configuration
diff --git a/log.c b/log.c
index 21e3673e..cbac2efd 100644
--- a/log.c
+++ b/log.c
@@ -85,7 +85,7 @@ static int logtime_fmt(char *buf, size_t size, const struct timespec *ts)
}
/* Prefixes for log file messages, indexed by priority */
-const char *logfile_prefix[] = {
+static const char *logfile_prefix[] = {
NULL, NULL, NULL, /* Unused: LOG_EMERG, LOG_ALERT, LOG_CRIT */
"ERROR: ",
"WARNING: ",
diff --git a/tcp.c b/tcp.c
index 92d9797a..d6a9ba28 100644
--- a/tcp.c
+++ b/tcp.c
@@ -370,8 +370,8 @@ enum {
*/
#define TCP_MIGRATE_SND_QUEUE_MAX (64 << 20)
#define TCP_MIGRATE_RCV_QUEUE_MAX (64 << 20)
-uint8_t tcp_migrate_snd_queue [TCP_MIGRATE_SND_QUEUE_MAX];
-uint8_t tcp_migrate_rcv_queue [TCP_MIGRATE_RCV_QUEUE_MAX];
+static uint8_t tcp_migrate_snd_queue [TCP_MIGRATE_SND_QUEUE_MAX];
+static uint8_t tcp_migrate_rcv_queue [TCP_MIGRATE_RCV_QUEUE_MAX];
#define TCP_MIGRATE_RESTORE_CHUNK_MIN 1024 /* Try smaller when above this */
@@ -420,7 +420,7 @@ char tcp_buf_discard [BUF_DISCARD_SIZE];
bool peek_offset_cap;
/* Size of data returned by TCP_INFO getsockopt() */
-socklen_t tcp_info_size;
+static socklen_t tcp_info_size;
#define tcp_info_cap(f_) \
((offsetof(struct tcp_info_linux, tcpi_##f_) + \
diff --git a/tcp_buf.c b/tcp_buf.c
index 41965b10..a092cb37 100644
--- a/tcp_buf.c
+++ b/tcp_buf.c
@@ -45,8 +45,8 @@ static struct ethhdr tcp_eth_hdr[TCP_FRAMES_MEM];
static struct tap_hdr tcp_payload_tap_hdr[TCP_FRAMES_MEM];
/* IP headers for IPv4 and IPv6 */
-struct iphdr tcp4_payload_ip[TCP_FRAMES_MEM];
-struct ipv6hdr tcp6_payload_ip[TCP_FRAMES_MEM];
+static struct iphdr tcp4_payload_ip[TCP_FRAMES_MEM];
+static struct ipv6hdr tcp6_payload_ip[TCP_FRAMES_MEM];
/* TCP segments with payload for IPv4 and IPv6 frames */
static struct tcp_payload_t tcp_payload[TCP_FRAMES_MEM];
--
2.54.0
next prev parent reply other threads:[~2026-05-11 10:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:03 [PATCH 0/8] Fix assorted warnings David Gibson
2026-05-11 10:03 ` [PATCH 1/8] netlink: erromsg should be const in nl_status() David Gibson
2026-05-11 12:50 ` Laurent Vivier
2026-05-11 10:03 ` [PATCH 2/8] virtio: Reduce scope of variable David Gibson
2026-05-11 12:51 ` Laurent Vivier
2026-05-11 10:03 ` [PATCH 3/8] conf: Fix not-actually-const parameter to conf_runas() and conf_ugid() David Gibson
2026-05-11 13:00 ` Laurent Vivier
2026-05-11 10:03 ` [PATCH 4/8] clang-tidy: Squash inconsistent brace warnings in foreach macros David Gibson
2026-05-11 13:21 ` Laurent Vivier
2026-05-11 10:03 ` [PATCH 5/8] clang-tidy: Suppress sscanf() warning harder David Gibson
2026-05-11 13:23 ` Laurent Vivier
2026-05-11 10:03 ` [PATCH 6/8] packet, clang-tidy: Packet pool buffers are not NULL David Gibson
2026-05-11 13:27 ` Laurent Vivier
2026-05-11 10:03 ` David Gibson [this message]
2026-05-11 13:30 ` [PATCH 7/8] treewide: Make some additional variables static Laurent Vivier
2026-05-11 10:03 ` [PATCH 8/8] clang-tidy: Suppress some new unhelpful new warnings David Gibson
2026-05-11 13:32 ` Laurent Vivier
2026-05-12 5:45 ` [PATCH 0/8] Fix assorted warnings Stefano Brivio
Reply instructions:
You may reply publicly 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=20260511100322.1016757-8-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).