tools lib traceevent: Use 'const' in variables pointing to const strings

Fixing the build on fedora 14, 32-bit:

  tools/lib/traceevent/event-parse.c: In function ‘find_cmdline’:
  tools/lib/traceevent/event-parse.c:183:3: error: return discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c:186:3: error: return discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c:195:2: error: return discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c: In function ‘process_func_handler’:
  tools/lib/traceevent/event-parse.c:2658:9: error: assignment discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c:2660:9: error: assignment discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c: In function ‘print_mac_arg’:
  tools/lib/traceevent/event-parse.c:3892:14: error: initialization discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c:3906:7: error: assignment discards qualifiers from pointer target type
  tools/lib/traceevent/event-parse.c: In function ‘pevent_print_event’:
  tools/lib/traceevent/event-parse.c:4412:24: error: initialization discards qualifiers from pointer target type

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-0k5g8urwu7vwkgbcbt2x05fe@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7a905611
...@@ -174,7 +174,7 @@ static int cmdline_init(struct pevent *pevent) ...@@ -174,7 +174,7 @@ static int cmdline_init(struct pevent *pevent)
return 0; return 0;
} }
static char *find_cmdline(struct pevent *pevent, int pid) static const char *find_cmdline(struct pevent *pevent, int pid)
{ {
const struct cmdline *comm; const struct cmdline *comm;
struct cmdline key; struct cmdline key;
...@@ -2637,7 +2637,7 @@ process_func_handler(struct event_format *event, struct pevent_function_handler ...@@ -2637,7 +2637,7 @@ process_func_handler(struct event_format *event, struct pevent_function_handler
struct print_arg *farg; struct print_arg *farg;
enum event_type type; enum event_type type;
char *token; char *token;
char *test; const char *test;
int i; int i;
arg->type = PRINT_FUNC; arg->type = PRINT_FUNC;
...@@ -3889,7 +3889,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, ...@@ -3889,7 +3889,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
struct event_format *event, struct print_arg *arg) struct event_format *event, struct print_arg *arg)
{ {
unsigned char *buf; unsigned char *buf;
char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"; const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";
if (arg->type == PRINT_FUNC) { if (arg->type == PRINT_FUNC) {
process_defined_func(s, data, size, event, arg); process_defined_func(s, data, size, event, arg);
...@@ -4409,7 +4409,7 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event, ...@@ -4409,7 +4409,7 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
void pevent_print_event(struct pevent *pevent, struct trace_seq *s, void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
struct pevent_record *record) struct pevent_record *record)
{ {
static char *spaces = " "; /* 20 spaces */ static const char *spaces = " "; /* 20 spaces */
struct event_format *event; struct event_format *event;
unsigned long secs; unsigned long secs;
unsigned long usecs; unsigned long usecs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment