summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/newt.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-07-15 12:21:07 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-17 20:44:43 +0200
commit63f20e744a595444f7ab1d47a29c5b74830feb47 (patch)
tree7d57393b56b9371e3e664e815a81a0fb77f64fb4 /tools/perf/util/newt.c
parentMerge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/fre... (diff)
downloadlinux-63f20e744a595444f7ab1d47a29c5b74830feb47.tar.xz
linux-63f20e744a595444f7ab1d47a29c5b74830feb47.zip
perf ui: Make END go to the last entry, not the top of the last page
Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/newt.c')
-rw-r--r--tools/perf/util/newt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 06f248fde5cf..932f12468c3c 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
break;
case NEWT_KEY_END:
offset = self->height - 1;
+ if (offset >= self->nr_entries)
+ offset = self->nr_entries - 1;
- if (offset > self->nr_entries)
- offset = self->nr_entries;
-
- self->index = self->first_visible_entry_idx = self->nr_entries - 1 - offset;
+ self->index = self->nr_entries - 1;
+ self->first_visible_entry_idx = self->index - offset;
self->seek(self, -offset, SEEK_END);
break;
case NEWT_KEY_RIGHT: