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

perf tools: Use __maybe_unused consistently

Instead of defining __unused or redefining __maybe_unused.

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-4eleto5pih31jw1q4dypm9pf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+8 -11
+1 -1
tools/perf/bench/numa.c
··· 700 700 * kernel (KSM, zero page, etc.) cannot optimize away RAM 701 701 * accesses: 702 702 */ 703 - static inline u64 access_data(u64 *data __attribute__((unused)), u64 val) 703 + static inline u64 access_data(u64 *data, u64 val) 704 704 { 705 705 if (g->p.data_reads) 706 706 val += *data;
-2
tools/perf/jvmti/jvmti_agent.h
··· 5 5 #include <stdint.h> 6 6 #include <jvmti.h> 7 7 8 - #define __unused __attribute__((unused)) 9 - 10 8 #if defined(__cplusplus) 11 9 extern "C" { 12 10 #endif
+3 -2
tools/perf/jvmti/libjvmti.c
··· 1 + #include <linux/compiler.h> 1 2 #include <sys/types.h> 2 3 #include <stdio.h> 3 4 #include <string.h> ··· 239 238 } 240 239 241 240 JNIEXPORT jint JNICALL 242 - Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused) 241 + Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __maybe_unused) 243 242 { 244 243 jvmtiEventCallbacks cb; 245 244 jvmtiCapabilities caps1; ··· 314 313 } 315 314 316 315 JNIEXPORT void JNICALL 317 - Agent_OnUnload(JavaVM *jvm __unused) 316 + Agent_OnUnload(JavaVM *jvm __maybe_unused) 318 317 { 319 318 int ret; 320 319
-4
tools/perf/pmu-events/jevents.c
··· 48 48 #include "json.h" 49 49 #include "jevents.h" 50 50 51 - #ifndef __maybe_unused 52 - #define __maybe_unused __attribute__((unused)) 53 - #endif 54 - 55 51 int verbose; 56 52 char *prog; 57 53
+2 -1
tools/perf/util/evsel.c
··· 15 15 #include <traceevent/event-parse.h> 16 16 #include <linux/hw_breakpoint.h> 17 17 #include <linux/perf_event.h> 18 + #include <linux/compiler.h> 18 19 #include <linux/err.h> 19 20 #include <sys/ioctl.h> 20 21 #include <sys/resource.h> ··· 1442 1441 } 1443 1442 1444 1443 static int __open_attr__fprintf(FILE *fp, const char *name, const char *val, 1445 - void *priv __attribute__((unused))) 1444 + void *priv __maybe_unused) 1446 1445 { 1447 1446 return fprintf(fp, " %-32s %s\n", name, val); 1448 1447 }
+2 -1
tools/perf/util/header.c
··· 8 8 #include <unistd.h> 9 9 #include <stdio.h> 10 10 #include <stdlib.h> 11 + #include <linux/compiler.h> 11 12 #include <linux/list.h> 12 13 #include <linux/kernel.h> 13 14 #include <linux/bitops.h> ··· 1275 1274 } 1276 1275 1277 1276 static int __desc_attr__fprintf(FILE *fp, const char *name, const char *val, 1278 - void *priv __attribute__((unused))) 1277 + void *priv __maybe_unused) 1279 1278 { 1280 1279 return fprintf(fp, ", %s = %s", name, val); 1281 1280 }