netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2 1/7] utils: make local cmdline functions static
Date: Thu,  1 Jun 2023 10:21:39 -0700	[thread overview]
Message-ID: <20230601172145.51357-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20230601172145.51357-1-stephen@networkplumber.org>

No need to expose these parts of command line parsing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 include/utils.h | 3 ---
 lib/utils.c     | 6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 0f1b3bef34d8..0b5d86a26488 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -139,7 +139,6 @@ int get_addr_rta(inet_prefix *dst, const struct rtattr *rta, int family);
 int get_addr_ila(__u64 *val, const char *arg);
 
 int read_prop(const char *dev, char *prop, long *value);
-int get_hex(char c);
 int get_integer(int *val, const char *arg, int base);
 int get_unsigned(unsigned *val, const char *arg, int base);
 int get_time_rtt(unsigned *val, const char *arg, int *raw);
@@ -304,8 +303,6 @@ unsigned int print_name_and_link(const char *fmt,
 #define ntohll(x) ((1==ntohl(1)) ? (x) : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
 
 extern int cmdlineno;
-ssize_t getcmdline(char **line, size_t *len, FILE *in);
-int makeargs(char *line, char *argv[], int maxargs);
 
 char *int_to_str(int val, char *buf);
 int get_guid(__u64 *guid, const char *arg);
diff --git a/lib/utils.c b/lib/utils.c
index 8dc302bdfe02..01f3a5f7e4ea 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -96,7 +96,7 @@ out:
 	return -1;
 }
 
-int get_hex(char c)
+static int get_hex(char c)
 {
 	if (c >= 'A' && c <= 'F')
 		return c - 'A' + 10;
@@ -1289,7 +1289,7 @@ unsigned int print_name_and_link(const char *fmt,
 int cmdlineno;
 
 /* Like glibc getline but handle continuation lines and comments */
-ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
+static ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
 {
 	ssize_t cc;
 	char *cp;
@@ -1336,7 +1336,7 @@ ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
 }
 
 /* split command line into argument vector */
-int makeargs(char *line, char *argv[], int maxargs)
+static int makeargs(char *line, char *argv[], int maxargs)
 {
 	static const char ws[] = " \t\r\n";
 	char *cp = line;
-- 
2.39.2


  reply	other threads:[~2023-06-01 17:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 17:21 [PATCH iproute2 0/7] localize functions where possible Stephen Hemminger
2023-06-01 17:21 ` Stephen Hemminger [this message]
2023-06-01 17:21 ` [PATCH iproute2 2/7] libnetlink: drop unused rtnl_talk_iov Stephen Hemminger
2023-06-01 17:21 ` [PATCH iproute2 3/7] bridge: make print_vlan_info static Stephen Hemminger
2023-06-01 17:25   ` Nikolay Aleksandrov
2023-06-01 17:21 ` [PATCH iproute2 4/7] rt_names: drop unused rtnl_addrprot_a2n Stephen Hemminger
2023-06-01 17:21 ` [PATCH iproute2 5/7] ip: make print_rta_gateway static Stephen Hemminger
2023-06-01 17:21 ` [PATCH iproute2 6/7] xfrm: make xfrm_stat_print_nokeys static Stephen Hemminger
2023-06-01 17:21 ` [PATCH iproute2 7/7] rdma: make rd_attr_check static Stephen Hemminger

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=20230601172145.51357-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).