summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2009-10-05 13:17:29 -0700
committerIngo Molnar <mingo@elte.hu>2009-10-12 08:35:00 +0200
commitcbef79a82a64ec13e745ce2b0274154ae1e47243 (patch)
treeda128daca6c33c9280d0f01400c4766ed4a89c76 /tools/perf/builtin-sched.c
parentd93a8f829fe1d2f3002f2c6ddb553d12db420412 (diff)
downloadlinux-3.10-cbef79a82a64ec13e745ce2b0274154ae1e47243.tar.gz
linux-3.10-cbef79a82a64ec13e745ce2b0274154ae1e47243.tar.bz2
linux-3.10-cbef79a82a64ec13e745ce2b0274154ae1e47243.zip
perf tools: Fix const char type propagation
The following perf build warnings/errors in function argument types: builtin-sched.c:1894: warning: passing argument 1 of 'sort_dimension__add' discards qualifiers from pointer target type util/trace-event-parse.c:685: warning: passing argument 2 of 'read_expected' discards qualifiers from pointer target type util/trace-event-parse.c:741: warning: passing argument 4 of 'test_type_token' discards qualifiers from pointer target type util/trace-event-parse.c:706: warning: passing argument 2 of 'read_expected_item' discards qualifiers from pointer target type ... trigger because older GCC is not able to prove that sort_dimension__add() does not change the string. Some goes for test_type_token(). Fix this by improving type consistency. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20091005131729.78444bfb.randy.dunlap@oracle.com> [ Also remove ugly type cast now unnecessary. ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index ea9c15c0cdf..ce2d5be4f30 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1287,7 +1287,7 @@ static struct sort_dimension *available_sorts[] = {
static LIST_HEAD(sort_list);
-static int sort_dimension__add(char *tok, struct list_head *list)
+static int sort_dimension__add(const char *tok, struct list_head *list)
{
int i;
@@ -1917,7 +1917,7 @@ static void setup_sorting(void)
free(str);
- sort_dimension__add((char *)"pid", &cmp_pid);
+ sort_dimension__add("pid", &cmp_pid);
}
static const char *record_args[] = {