diff mbox series

[iproute2-next,3/7] tc/util: remove unused argument from print_action_control

Message ID 20240413220516.7235-4-stephen@networkplumber.org (mailing list archive)
State Accepted
Delegated to: David Ahern
Headers show
Series unused arguments | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger April 13, 2024, 10:04 p.m. UTC
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 mbox series

Patch

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);