]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf probe: Remove redundant checks
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 Feb 2011 09:56:18 +0000 (06:56 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 Feb 2011 10:02:07 +0000 (07:02 -0300)
While fixing an error propagating problem in f809b25 I added two
redundant checks.

I did that because I didn't expect the checks to be on the while and for
loop condition expression, where they are tested before we run the loop,
where the 'ret' variable is set.

So remove it from there and leave it just after it is actually set,
eliminating unneded tests.

Reported-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.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: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c
tools/perf/util/probe-finder.c

index 369ddc64bbb6a6d81aea0b9f92075fe5315af178..5ddee66020a70c8b74f4b53caf3aa002f56f3d75 100644 (file)
@@ -1832,7 +1832,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
        }
 
        /* Loop 2: add all events */
-       for (i = 0; i < npevs && ret >= 0; i++) {
+       for (i = 0; i < npevs; i++) {
                ret = __add_probe_trace_events(pkgs[i].pev, pkgs[i].tevs,
                                                pkgs[i].ntevs, force_add);
                if (ret < 0)
index eecbdca5c0d5ec8b7659c8036d69bb83366a6c4b..17f9c4a66ddd3575f6ea6de65bfbf6e4748b04a4 100644 (file)
@@ -1462,8 +1462,7 @@ static int find_probes(int fd, struct probe_finder *pf)
        off = 0;
        line_list__init(&pf->lcache);
        /* Loop on CUs (Compilation Unit) */
-       while (!dwarf_nextcu(dbg, off, &noff, &cuhl, NULL, NULL, NULL) &&
-              ret >= 0) {
+       while (!dwarf_nextcu(dbg, off, &noff, &cuhl, NULL, NULL, NULL)) {
                /* Get the DIE(Debugging Information Entry) of this CU */
                diep = dwarf_offdie(dbg, off + cuhl, &pf->cu_die);
                if (!diep)
@@ -1484,7 +1483,7 @@ static int find_probes(int fd, struct probe_finder *pf)
                                pf->lno = pp->line;
                                ret = find_probe_point_by_line(pf);
                        }
-                       if (ret != DWARF_CB_OK)
+                       if (ret < 0)
                                break;
                }
                off = noff;