diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-16 16:39:15 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-19 20:14:58 +0200 |
commit | 6c3466435b03fb84647f5ad413f98f2ccb12b5c2 (patch) | |
tree | 55e93240208b072307f144520766a4fd75dd15d5 /tools/perf/util/usage.c | |
parent | perf script: Allow adding and removing fields (diff) | |
download | linux-6c3466435b03fb84647f5ad413f98f2ccb12b5c2.tar.xz linux-6c3466435b03fb84647f5ad413f98f2ccb12b5c2.zip |
tools: Adopt __noreturn from kernel sources
To have a more compact way to specify that a function doesn't return,
instead of the open coded:
__attribute__((noreturn))
And use it instead of the tools/perf/ specific variation, NORETURN.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-l0y144qzixcy5t4c6i7pdiqj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/usage.c')
-rw-r--r-- | tools/perf/util/usage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index 996046a66fe5..aacb65e079aa 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c @@ -16,13 +16,13 @@ static void report(const char *prefix, const char *err, va_list params) fprintf(stderr, " %s%s\n", prefix, msg); } -static NORETURN void usage_builtin(const char *err) +static __noreturn void usage_builtin(const char *err) { fprintf(stderr, "\n Usage: %s\n", err); exit(129); } -static NORETURN void die_builtin(const char *err, va_list params) +static __noreturn void die_builtin(const char *err, va_list params) { report(" Fatal: ", err, params); exit(128); @@ -40,7 +40,7 @@ static void warn_builtin(const char *warn, va_list params) /* If we are in a dlopen()ed .so write to a global variable would segfault * (ugh), so keep things static. */ -static void (*usage_routine)(const char *err) NORETURN = usage_builtin; +static void (*usage_routine)(const char *err) __noreturn = usage_builtin; static void (*error_routine)(const char *err, va_list params) = error_builtin; static void (*warn_routine)(const char *err, va_list params) = warn_builtin; |