From aa22dd4990e38700b1855555aa0def5215859abb Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Wed, 16 May 2012 18:45:47 +0900 Subject: 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 Suggested-by: David Ahern Suggested-by: Ingo Molnar Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1337161549-9870-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/target.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/perf/util/target.h') 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 */ -- cgit v1.2.3-59-g8ed1b