[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180710210558.20278-3-stephen@networkplumber.org>
Date: Tue, 10 Jul 2018 14:05:29 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <sthemmin@...rosoft.com>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH v2 iproute2-next 02/31] tc: use const char in util
From: Stephen Hemminger <sthemmin@...rosoft.com>
For prefix and path, can use const char.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
tc/tc_util.c | 8 +++++---
tc/tc_util.h | 6 +++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tc/tc_util.c b/tc/tc_util.c
index e0c96291ade0..e8e1241d083d 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -35,7 +35,7 @@ static struct db_names *cls_names;
#define NAMES_DB "/etc/iproute2/tc_cls"
-int cls_names_init(char *path)
+int cls_names_init(const char *path)
{
int ret;
@@ -800,7 +800,8 @@ void print_tm(FILE *f, const struct tcf_t *tm)
}
}
-void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtattr **xstats)
+void print_tcstats2_attr(FILE *fp, struct rtattr *rta,
+ const char *prefix, struct rtattr **xstats)
{
SPRINT_BUF(b1);
struct rtattr *tbs[TCA_STATS_MAX + 1];
@@ -868,7 +869,8 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
*xstats = tbs[TCA_STATS_APP] ? : NULL;
}
-void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtattr **xstats)
+void print_tcstats_attr(FILE *fp, struct rtattr *tb[],
+ const char *prefix, struct rtattr **xstats)
{
SPRINT_BUF(b1);
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 6632c4f9c528..64b309903c69 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -100,9 +100,9 @@ char *sprint_ticks(__u32 ticks, char *buf);
char *sprint_linklayer(unsigned int linklayer, char *buf);
void print_tcstats_attr(FILE *fp, struct rtattr *tb[],
- char *prefix, struct rtattr **xstats);
+ const char *prefix, struct rtattr **xstats);
void print_tcstats2_attr(FILE *fp, struct rtattr *rta,
- char *prefix, struct rtattr **xstats);
+ const char *prefix, struct rtattr **xstats);
int get_tc_classid(__u32 *h, const char *str);
int print_tc_classid(char *buf, int len, __u32 h);
@@ -130,7 +130,7 @@ int parse_action(int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n);
void print_tm(FILE *f, const struct tcf_t *tm);
int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt);
-int cls_names_init(char *path);
+int cls_names_init(const char *path);
void cls_names_uninit(void);
int action_a2n(char *arg, int *result, bool allow_num);
--
2.18.0
Powered by blists - more mailing lists