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 4/4] tc: make exec_util arg const
Date: Tue, 12 Mar 2024 15:12:42 -0700	[thread overview]
Message-ID: <20240312221422.81253-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20240312221422.81253-1-stephen@networkplumber.org>

The callbacks in exec_util should not be modifying underlying
qdisc operations structure.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 tc/e_bpf.c   | 2 +-
 tc/tc_exec.c | 2 +-
 tc/tc_util.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tc/e_bpf.c b/tc/e_bpf.c
index 79cddace96a4..cca853f95299 100644
--- a/tc/e_bpf.c
+++ b/tc/e_bpf.c
@@ -49,7 +49,7 @@ static int bpf_num_env_entries(void)
 	return num;
 }
 
-static int parse_bpf(struct exec_util *eu, int argc, char **argv)
+static int parse_bpf(const struct exec_util *eu, int argc, char **argv)
 {
 	char **argv_run = argv_default, **envp_run, *tmp;
 	int ret, i, env_old, env_num, env_map;
diff --git a/tc/tc_exec.c b/tc/tc_exec.c
index 182fbb4c35c9..fe9fdb1b5aa6 100644
--- a/tc/tc_exec.c
+++ b/tc/tc_exec.c
@@ -26,7 +26,7 @@ static void usage(void)
 		"OPTIONS := ... try tc exec <desired EXEC_KIND> help\n");
 }
 
-static int parse_noeopt(struct exec_util *eu, int argc, char **argv)
+static int parse_noeopt(const struct exec_util *eu, int argc, char **argv)
 {
 	if (argc) {
 		fprintf(stderr, "Unknown exec \"%s\", hence option \"%s\" is unparsable\n",
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 5ae3fafd2dd2..bbb2961dfe93 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -68,7 +68,7 @@ struct action_util {
 struct exec_util {
 	struct exec_util *next;
 	char id[FILTER_NAMESZ];
-	int (*parse_eopt)(struct exec_util *eu, int argc, char **argv);
+	int (*parse_eopt)(const struct exec_util *eu, int argc, char **argv);
 };
 
 const char *get_tc_lib(void);
-- 
2.43.0


  parent reply	other threads:[~2024-03-12 22:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 22:12 [PATCH iproute2 0/4] constify tc XXX_util structures Stephen Hemminger
2024-03-12 22:12 ` [PATCH iproute2 1/4] tc: make qdisc_util arg const Stephen Hemminger
2024-03-12 22:12 ` [PATCH iproute2 2/4] tc: make filter_util args const Stephen Hemminger
2024-03-12 22:12 ` [PATCH iproute2 3/4] tc: make action_util arg const Stephen Hemminger
2024-03-12 22:12 ` Stephen Hemminger [this message]
2024-03-13 16:50 ` [PATCH iproute2 0/4] constify tc XXX_util structures patchwork-bot+netdevbpf

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=20240312221422.81253-5-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).