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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3ee350fb
...@@ -700,7 +700,7 @@ static inline uint32_t lfsr_32(uint32_t lfsr) ...@@ -700,7 +700,7 @@ static inline uint32_t lfsr_32(uint32_t lfsr)
* kernel (KSM, zero page, etc.) cannot optimize away RAM * kernel (KSM, zero page, etc.) cannot optimize away RAM
* accesses: * 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) if (g->p.data_reads)
val += *data; val += *data;
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#include <stdint.h> #include <stdint.h>
#include <jvmti.h> #include <jvmti.h>
#define __unused __attribute__((unused))
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
......
#include <linux/compiler.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -238,7 +239,7 @@ code_generated_cb(jvmtiEnv *jvmti, ...@@ -238,7 +239,7 @@ code_generated_cb(jvmtiEnv *jvmti,
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused) Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __maybe_unused)
{ {
jvmtiEventCallbacks cb; jvmtiEventCallbacks cb;
jvmtiCapabilities caps1; jvmtiCapabilities caps1;
...@@ -313,7 +314,7 @@ Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused) ...@@ -313,7 +314,7 @@ Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused)
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Agent_OnUnload(JavaVM *jvm __unused) Agent_OnUnload(JavaVM *jvm __maybe_unused)
{ {
int ret; int ret;
......
...@@ -48,10 +48,6 @@ ...@@ -48,10 +48,6 @@
#include "json.h" #include "json.h"
#include "jevents.h" #include "jevents.h"
#ifndef __maybe_unused
#define __maybe_unused __attribute__((unused))
#endif
int verbose; int verbose;
char *prog; char *prog;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <traceevent/event-parse.h> #include <traceevent/event-parse.h>
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <linux/compiler.h>
#include <linux/err.h> #include <linux/err.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/resource.h> #include <sys/resource.h>
...@@ -1441,7 +1442,7 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, ...@@ -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, 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); return fprintf(fp, " %-32s %s\n", name, val);
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <linux/compiler.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/bitops.h> #include <linux/bitops.h>
...@@ -1274,7 +1275,7 @@ read_event_desc(struct perf_header *ph, int fd) ...@@ -1274,7 +1275,7 @@ read_event_desc(struct perf_header *ph, int fd)
} }
static int __desc_attr__fprintf(FILE *fp, const char *name, const char *val, 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); return fprintf(fp, ", %s = %s", name, val);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment