Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf list: Remove a level of indentation

With a return after the if check an indentation level can be removed.
Indentation shift only; no functional changes.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1383149707-1008-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

David Ahern and committed by
Arnaldo Carvalho de Melo
8e00ddc9 5febff00

+37 -36
+37 -36
tools/perf/builtin-list.c
··· 17 17 18 18 int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) 19 19 { 20 + int i; 21 + 20 22 setup_pager(); 21 23 22 - if (argc == 1) 24 + if (argc == 1) { 23 25 print_events(NULL, false); 24 - else { 25 - int i; 26 + return 0; 27 + } 26 28 27 - for (i = 1; i < argc; ++i) { 28 - if (i > 2) 29 - putchar('\n'); 30 - if (strncmp(argv[i], "tracepoint", 10) == 0) 31 - print_tracepoint_events(NULL, NULL, false); 32 - else if (strcmp(argv[i], "hw") == 0 || 33 - strcmp(argv[i], "hardware") == 0) 34 - print_events_type(PERF_TYPE_HARDWARE); 35 - else if (strcmp(argv[i], "sw") == 0 || 36 - strcmp(argv[i], "software") == 0) 37 - print_events_type(PERF_TYPE_SOFTWARE); 38 - else if (strcmp(argv[i], "cache") == 0 || 39 - strcmp(argv[i], "hwcache") == 0) 40 - print_hwcache_events(NULL, false); 41 - else if (strcmp(argv[i], "pmu") == 0) 42 - print_pmu_events(NULL, false); 43 - else if (strcmp(argv[i], "--raw-dump") == 0) 44 - print_events(NULL, true); 45 - else { 46 - char *sep = strchr(argv[i], ':'), *s; 47 - int sep_idx; 29 + for (i = 1; i < argc; ++i) { 30 + if (i > 2) 31 + putchar('\n'); 32 + if (strncmp(argv[i], "tracepoint", 10) == 0) 33 + print_tracepoint_events(NULL, NULL, false); 34 + else if (strcmp(argv[i], "hw") == 0 || 35 + strcmp(argv[i], "hardware") == 0) 36 + print_events_type(PERF_TYPE_HARDWARE); 37 + else if (strcmp(argv[i], "sw") == 0 || 38 + strcmp(argv[i], "software") == 0) 39 + print_events_type(PERF_TYPE_SOFTWARE); 40 + else if (strcmp(argv[i], "cache") == 0 || 41 + strcmp(argv[i], "hwcache") == 0) 42 + print_hwcache_events(NULL, false); 43 + else if (strcmp(argv[i], "pmu") == 0) 44 + print_pmu_events(NULL, false); 45 + else if (strcmp(argv[i], "--raw-dump") == 0) 46 + print_events(NULL, true); 47 + else { 48 + char *sep = strchr(argv[i], ':'), *s; 49 + int sep_idx; 48 50 49 - if (sep == NULL) { 50 - print_events(argv[i], false); 51 - continue; 52 - } 53 - sep_idx = sep - argv[i]; 54 - s = strdup(argv[i]); 55 - if (s == NULL) 56 - return -1; 57 - 58 - s[sep_idx] = '\0'; 59 - print_tracepoint_events(s, s + sep_idx + 1, false); 60 - free(s); 51 + if (sep == NULL) { 52 + print_events(argv[i], false); 53 + continue; 61 54 } 55 + sep_idx = sep - argv[i]; 56 + s = strdup(argv[i]); 57 + if (s == NULL) 58 + return -1; 59 + 60 + s[sep_idx] = '\0'; 61 + print_tracepoint_events(s, s + sep_idx + 1, false); 62 + free(s); 62 63 } 63 64 } 64 65 return 0;