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-next 3/7] tc/util: remove unused argument from print_action_control
Date: Sat, 13 Apr 2024 15:04:04 -0700	[thread overview]
Message-ID: <20240413220516.7235-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20240413220516.7235-1-stephen@networkplumber.org>

The FILE handle is no longer used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 tc/m_bpf.c        | 2 +-
 tc/m_connmark.c   | 2 +-
 tc/m_csum.c       | 2 +-
 tc/m_ct.c         | 2 +-
 tc/m_ctinfo.c     | 2 +-
 tc/m_gact.c       | 4 ++--
 tc/m_gate.c       | 2 +-
 tc/m_ife.c        | 2 +-
 tc/m_mirred.c     | 2 +-
 tc/m_mpls.c       | 2 +-
 tc/m_nat.c        | 2 +-
 tc/m_pedit.c      | 2 +-
 tc/m_police.c     | 4 ++--
 tc/m_sample.c     | 2 +-
 tc/m_skbedit.c    | 2 +-
 tc/m_skbmod.c     | 2 +-
 tc/m_tunnel_key.c | 2 +-
 tc/m_vlan.c       | 2 +-
 tc/tc_util.c      | 3 +--
 tc/tc_util.h      | 3 +--
 20 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/tc/m_bpf.c b/tc/m_bpf.c
index 5cae51ba..f0cfd066 100644
--- a/tc/m_bpf.c
+++ b/tc/m_bpf.c
@@ -191,7 +191,7 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
 			     b, sizeof(b)));
 	}
 
-	print_action_control(f, "default-action ", parm->action, _SL_);
+	print_action_control("default-action ", parm->action, _SL_);
 	print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
 	print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt);
 	print_int(PRINT_ANY, "bind", " bind %d", parm->bindcnt);
diff --git a/tc/m_connmark.c b/tc/m_connmark.c
index bd388665..880500fa 100644
--- a/tc/m_connmark.c
+++ b/tc/m_connmark.c
@@ -112,7 +112,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
 	ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
 
 	print_uint(PRINT_ANY, "zone", "zone %u", ci->zone);
-	print_action_control(f, " ", ci->action, "");
+	print_action_control(" ", ci->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
diff --git a/tc/m_csum.c b/tc/m_csum.c
index 966ae18e..8724bf0d 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -204,7 +204,7 @@ print_csum(struct action_util *au, FILE *f, struct rtattr *arg)
 		 uflag_4, uflag_5, uflag_6, uflag_7);
 	print_string(PRINT_ANY, "csum", "(%s) ", buf);
 
-	print_action_control(f, "action ", sel->action, _SL_);
+	print_action_control("action ", sel->action, _SL_);
 	print_uint(PRINT_ANY, "index", "\tindex %u", sel->index);
 	print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
 	print_int(PRINT_ANY, "bind", " bind %d", sel->bindcnt);
diff --git a/tc/m_ct.c b/tc/m_ct.c
index 95098c88..3d71d8d4 100644
--- a/tc/m_ct.c
+++ b/tc/m_ct.c
@@ -523,7 +523,7 @@ static int print_ct(struct action_util *au, FILE *f, struct rtattr *arg)
 	ct_print_helper(tb[TCA_CT_HELPER_FAMILY], tb[TCA_CT_HELPER_PROTO], tb[TCA_CT_HELPER_NAME]);
 	ct_print_nat(ct_action, tb);
 
-	print_action_control(f, " ", p->action, "");
+	print_action_control(" ", p->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", p->index);
diff --git a/tc/m_ctinfo.c b/tc/m_ctinfo.c
index 606ab280..2021d46d 100644
--- a/tc/m_ctinfo.c
+++ b/tc/m_ctinfo.c
@@ -236,7 +236,7 @@ static int print_ctinfo(struct action_util *au, FILE *f, struct rtattr *arg)
 		zone = rta_getattr_u16(tb[TCA_CTINFO_ZONE]);
 
 	print_hu(PRINT_ANY, "zone", "zone %u", zone);
-	print_action_control(f, " ", ci->action, "");
+	print_action_control(" ", ci->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 0d90963c..111dff28 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -178,7 +178,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
 	}
 	p = RTA_DATA(tb[TCA_GACT_PARMS]);
 
-	print_action_control(f, "action ", p->action, "");
+	print_action_control("action ", p->action, "");
 #ifdef CONFIG_GACT_PROB
 	if (tb[TCA_GACT_PROB] != NULL) {
 		pp = RTA_DATA(tb[TCA_GACT_PROB]);
@@ -191,7 +191,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
 	print_nl();
 	print_string(PRINT_ANY, "random_type", "\t random type %s",
 		     prob_n2a(pp->ptype));
-	print_action_control(f, " ", pp->paction, " ");
+	print_action_control(" ", pp->paction, " ");
 	print_int(PRINT_ANY, "val", "val %d", pp->pval);
 	close_json_object();
 #endif
diff --git a/tc/m_gate.c b/tc/m_gate.c
index b2643ad8..ea49b09f 100644
--- a/tc/m_gate.c
+++ b/tc/m_gate.c
@@ -517,7 +517,7 @@ static int print_gate(struct action_util *au, FILE *f, struct rtattr *arg)
 	if (tb[TCA_GATE_ENTRY_LIST])
 		print_gate_list(tb[TCA_GATE_ENTRY_LIST]);
 
-	print_action_control(f, "\t", parm->action, "");
+	print_action_control("\t", parm->action, "");
 
 	print_uint(PRINT_ANY, "index", "\n\t index %u", parm->index);
 	print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt);
diff --git a/tc/m_ife.c b/tc/m_ife.c
index f5b2d52d..08b9d7de 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -236,7 +236,7 @@ static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
 
 	print_string(PRINT_ANY, "mode", "%s ",
 		     p->flags & IFE_ENCODE ? "encode" : "decode");
-	print_action_control(f, "action ", p->action, " ");
+	print_action_control("action ", p->action, " ");
 
 	if (tb[TCA_IFE_TYPE]) {
 		ife_type = rta_getattr_u16(tb[TCA_IFE_TYPE]);
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index 5e9856e0..714f2472 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -337,7 +337,7 @@ print_mirred(struct action_util *au, FILE *f, struct rtattr *arg)
 		print_string(PRINT_ANY, "to_dev", " to device %s)", dev);
 	}
 
-	print_action_control(f, " ", p->action, "");
+	print_action_control(" ", p->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\tindex %u", p->index);
diff --git a/tc/m_mpls.c b/tc/m_mpls.c
index a378e35e..65b7163d 100644
--- a/tc/m_mpls.c
+++ b/tc/m_mpls.c
@@ -272,7 +272,7 @@ static int print_mpls(struct action_util *au, FILE *f, struct rtattr *arg)
 		}
 		break;
 	}
-	print_action_control(f, " ", parm->action, "");
+	print_action_control(" ", parm->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
diff --git a/tc/m_nat.c b/tc/m_nat.c
index e4c74b08..ec421cdc 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -169,7 +169,7 @@ print_nat(struct action_util *au, FILE * f, struct rtattr *arg)
 	print_string(PRINT_ANY, "new_addr", " %s",
 		     format_host_r(AF_INET, 4, &sel->new_addr, buf1, sizeof(buf1)));
 
-	print_action_control(f, " ", sel->action, "");
+	print_action_control(" ", sel->action, "");
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", sel->index);
 	print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index fc06d04b..5afa33d9 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -791,7 +791,7 @@ static int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg)
 		}
 	}
 
-	print_action_control(f, "action ", sel->action, " ");
+	print_action_control("action ", sel->action, " ");
 	print_uint(PRINT_ANY, "nkeys", "keys %d\n", sel->nkeys);
 	print_uint(PRINT_ANY, "index", " \t index %u", sel->index);
 	print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
diff --git a/tc/m_police.c b/tc/m_police.c
index d140c1eb..02e50142 100644
--- a/tc/m_police.c
+++ b/tc/m_police.c
@@ -325,12 +325,12 @@ static int print_police(struct action_util *a, FILE *f, struct rtattr *arg)
 		print_u64(PRINT_ANY, "pkts_burst", "pkts_burst %llu ", ppsburst64);
 	}
 
-	print_action_control(f, "action ", p->action, "");
+	print_action_control("action ", p->action, "");
 
 	if (tb[TCA_POLICE_RESULT]) {
 		__u32 action = rta_getattr_u32(tb[TCA_POLICE_RESULT]);
 
-		print_action_control(f, "/", action, " ");
+		print_action_control("/", action, " ");
 	} else {
 		print_string(PRINT_FP, NULL, " ", NULL);
 	}
diff --git a/tc/m_sample.c b/tc/m_sample.c
index 36e4c1db..6e2bca58 100644
--- a/tc/m_sample.c
+++ b/tc/m_sample.c
@@ -160,7 +160,7 @@ static int print_sample(struct action_util *au, FILE *f, struct rtattr *arg)
 		print_uint(PRINT_ANY, "trunc_size", " trunc_size %u",
 			   rta_getattr_u32(tb[TCA_SAMPLE_TRUNC_SIZE]));
 
-	print_action_control(f, " ", p->action, "");
+	print_action_control(" ", p->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", p->index);
diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c
index 00b245ee..8e25c268 100644
--- a/tc/m_skbedit.c
+++ b/tc/m_skbedit.c
@@ -239,7 +239,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 				     "inheritdsfield");
 	}
 
-	print_action_control(f, " ", p->action, "");
+	print_action_control(" ", p->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", p->index);
diff --git a/tc/m_skbmod.c b/tc/m_skbmod.c
index c7a2ccd5..acb118b5 100644
--- a/tc/m_skbmod.c
+++ b/tc/m_skbmod.c
@@ -178,7 +178,7 @@ static int print_skbmod(struct action_util *au, FILE *f, struct rtattr *arg)
 	p = RTA_DATA(tb[TCA_SKBMOD_PARMS]);
 
 	fprintf(f, "skbmod ");
-	print_action_control(f, "", p->action, " ");
+	print_action_control("", p->action, " ");
 
 	if (tb[TCA_SKBMOD_ETYPE]) {
 		skbmod_etype = rta_getattr_u16(tb[TCA_SKBMOD_ETYPE]);
diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c
index e62f9118..83adb09c 100644
--- a/tc/m_tunnel_key.c
+++ b/tc/m_tunnel_key.c
@@ -731,7 +731,7 @@ static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg)
 					  tb[TCA_TUNNEL_KEY_ENC_TTL]);
 		break;
 	}
-	print_action_control(f, " ", parm->action, "");
+	print_action_control(" ", parm->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index 31d3b06f..fb5a0669 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -282,7 +282,7 @@ static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg)
 			print_string(PRINT_ANY, "src_mac", " src_mac %s", b1);
 		}
 	}
-	print_action_control(f, " ", parm->action, "");
+	print_action_control(" ", parm->action, "");
 
 	print_nl();
 	print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 25c8d6b6..133fe9f9 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -539,8 +539,7 @@ int parse_action_control_slash(int *argc_p, char ***argv_p,
 	return 0;
 }
 
-void print_action_control(FILE *f, const char *prefix,
-			  int action, const char *suffix)
+void print_action_control(const char *prefix, int action, const char *suffix)
 {
 	print_string(PRINT_FP, NULL, "%s", prefix);
 	open_json_object("control_action");
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 152ef3e6..851c2092 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -109,8 +109,7 @@ void parse_action_control_dflt(int *argc_p, char ***argv_p,
 			       int default_result);
 int parse_action_control_slash(int *argc_p, char ***argv_p,
 			       int *result1_p, int *result2_p, bool allow_num);
-void print_action_control(FILE *f, const char *prefix,
-			  int action, const char *suffix);
+void print_action_control(const char *prefix, int action, const char *suffix);
 int police_print_xstats(struct action_util *a, FILE *f, struct rtattr *tb);
 int tc_print_action(FILE *f, const struct rtattr *tb, unsigned short tot_acts);
 int parse_action(int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n);
-- 
2.43.0


  parent reply	other threads:[~2024-04-13 22:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 22:04 [PATCH iproute2-next 0/7] unused arguments Stephen Hemminger
2024-04-13 22:04 ` [PATCH iproute2-next 1/7] tc/u32: remove FILE argument Stephen Hemminger
2024-04-13 22:04 ` [PATCH iproute2-next 2/7] tc/util: remove unused argument from print_tm Stephen Hemminger
2024-04-13 22:04 ` Stephen Hemminger [this message]
2024-04-13 22:04 ` [PATCH iproute2-next 4/7] tc/police: remove unused argument to tc_print_police Stephen Hemminger
2024-04-13 22:04 ` [PATCH iproute2-next 5/7] tc/util: remove unused argument from print_tcstats2_attr Stephen Hemminger
2024-04-13 22:04 ` [PATCH iproute2-next 6/7] tc/action: remove unused args from tc_print_action Stephen Hemminger
2024-04-13 22:04 ` [PATCH iproute2-next 7/7] tc/police: remove unused prototype police_print_xstats Stephen Hemminger
2024-04-21  1:51 ` [PATCH iproute2-next 0/7] unused arguments David Ahern

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=20240413220516.7235-4-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).