summaryrefslogtreecommitdiff
path: root/tools/perf/util/target.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-05-16 13:45:47 +0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-16 19:09:34 +0400
commitaa22dd4990e38700b1855555aa0def5215859abb (patch)
treeb49e4b99db265a0dc7bd38d5605396889985e395 /tools/perf/util/target.h
parent978da300c7a65494692b329a6a4cbf364afc37c5 (diff)
downloadlinux-aa22dd4990e38700b1855555aa0def5215859abb.tar.xz
perf target: Rename functions to avoid double negation
Rename perf_target__no_{cpu,task} to perf_target__has_{cpu,task} because it's more intuitive and easy to parse (for human beings) when used with negation. The names are came out from David Ahern. It is intended to be a mechanical substitution without any functional change. The perf_target__none remains unchanged since I couldn't find a right name and it is hardly used with negation. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Suggested-by: David Ahern <dsahern@gmail.com> Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337161549-9870-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/target.h')
-rw-r--r--tools/perf/util/target.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index 127cff3f8ced..c43f632955fa 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -46,19 +46,19 @@ enum perf_target_errno perf_target__parse_uid(struct perf_target *target);
int perf_target__strerror(struct perf_target *target, int errnum, char *buf,
size_t buflen);
-static inline bool perf_target__no_task(struct perf_target *target)
+static inline bool perf_target__has_task(struct perf_target *target)
{
- return !target->pid && !target->tid && !target->uid_str;
+ return target->tid || target->pid || target->uid_str;
}
-static inline bool perf_target__no_cpu(struct perf_target *target)
+static inline bool perf_target__has_cpu(struct perf_target *target)
{
- return !target->system_wide && !target->cpu_list;
+ return target->system_wide || target->cpu_list;
}
static inline bool perf_target__none(struct perf_target *target)
{
- return perf_target__no_task(target) && perf_target__no_cpu(target);
+ return !perf_target__has_task(target) && !perf_target__has_cpu(target);
}
#endif /* _PERF_TARGET_H */