Commit 9fafd98f1bf14276f95b69f0186ad5675f1e1a18

Authored by Jiri Olsa
Committed by Arnaldo Carvalho de Melo
1 parent 842f07f612

perf tools: Fix various casting issues for 32 bits

- util/parse-events.c(parse_events_add_breakpoint)
  need to use unsigned long instead of u64, otherwise
  we get following gcc error on 32 bits:
     error: cast from pointer to integer of different size

- util/header.c(print_event_desc)
  cannot retype to signed type, otherwise we get following
  gcc error on 32 bits:
     error: comparison between signed and unsigned integer expressions

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1332267341-26338-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

tools/perf/util/header.c
... ... @@ -1177,7 +1177,7 @@
1177 1177 goto error;
1178 1178  
1179 1179 msz = sizeof(attr);
1180   - if (sz < (ssize_t)msz)
  1180 + if (sz < msz)
1181 1181 msz = sz;
1182 1182  
1183 1183 for (i = 0 ; i < nre; i++) {
tools/perf/util/parse-events.c
... ... @@ -569,7 +569,7 @@
569 569 char name[MAX_NAME_LEN];
570 570  
571 571 memset(&attr, 0, sizeof(attr));
572   - attr.bp_addr = (u64) ptr;
  572 + attr.bp_addr = (unsigned long) ptr;
573 573  
574 574 if (parse_breakpoint_type(type, &attr))
575 575 return -EINVAL;