perf tools: Use __maybe_unused consistently
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Jun 2017 15:18:27 +0000 (12:18 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 19 Jun 2017 18:27:06 +0000 (15:27 -0300)
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>
tools/perf/bench/numa.c
tools/perf/jvmti/jvmti_agent.h
tools/perf/jvmti/libjvmti.c
tools/perf/pmu-events/jevents.c
tools/perf/util/evsel.c
tools/perf/util/header.c

index 27de0c8c5c19a19e42f20c15f4d198cf31405857..469d65b2112285f47a222cb83515500b4df6f08c 100644 (file)
@@ -700,7 +700,7 @@ static inline uint32_t lfsr_32(uint32_t lfsr)
  * kernel (KSM, zero page, etc.) cannot optimize away RAM
  * accesses:
  */
-static inline u64 access_data(u64 *data __attribute__((unused)), u64 val)
+static inline u64 access_data(u64 *data, u64 val)
 {
        if (g->p.data_reads)
                val += *data;
index bedf5d0ba9ff928ec79f450a170328775a48d37d..c53a41f48b63419fcdb078ab28fc4d5227f66d3e 100644 (file)
@@ -5,8 +5,6 @@
 #include <stdint.h>
 #include <jvmti.h>
 
-#define __unused __attribute__((unused))
-
 #if defined(__cplusplus)
 extern "C" {
 #endif
index 5612641c69b403d00dbcb5f344600361301faf27..6d710904c8379c3339d065d9eb34c06479c76e48 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/compiler.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
@@ -238,7 +239,7 @@ code_generated_cb(jvmtiEnv *jvmti,
 }
 
 JNIEXPORT jint JNICALL
-Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused)
+Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __maybe_unused)
 {
        jvmtiEventCallbacks cb;
        jvmtiCapabilities caps1;
@@ -313,7 +314,7 @@ Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused)
 }
 
 JNIEXPORT void JNICALL
-Agent_OnUnload(JavaVM *jvm __unused)
+Agent_OnUnload(JavaVM *jvm __maybe_unused)
 {
        int ret;
 
index baa073f3833475ac422e20d1ba080d18c11ed82b..bd0aabb2bd0fafeb4453119eb3dcad7360816d37 100644 (file)
 #include "json.h"
 #include "jevents.h"
 
-#ifndef __maybe_unused
-#define __maybe_unused                  __attribute__((unused))
-#endif
-
 int verbose;
 char *prog;
 
index cda44b0e821c63baea1f9da52123184768fdd2f4..7f78f27f53824f1f17dda10fb0d37224d557fc99 100644 (file)
@@ -15,6 +15,7 @@
 #include <traceevent/event-parse.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/perf_event.h>
+#include <linux/compiler.h>
 #include <linux/err.h>
 #include <sys/ioctl.h>
 #include <sys/resource.h>
@@ -1441,7 +1442,7 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
 }
 
 static int __open_attr__fprintf(FILE *fp, const char *name, const char *val,
-                               void *priv __attribute__((unused)))
+                               void *priv __maybe_unused)
 {
        return fprintf(fp, "  %-32s %s\n", name, val);
 }
index b5baff3007bbd477551cc2e62770e534d0919f33..76ed7d03e500fa246776689e85df53a89171f79a 100644 (file)
@@ -8,6 +8,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <linux/compiler.h>
 #include <linux/list.h>
 #include <linux/kernel.h>
 #include <linux/bitops.h>
@@ -1274,7 +1275,7 @@ error:
 }
 
 static int __desc_attr__fprintf(FILE *fp, const char *name, const char *val,
-                               void *priv __attribute__((unused)))
+                               void *priv __maybe_unused)
 {
        return fprintf(fp, ", %s = %s", name, val);
 }