perf tools: Use __maybe_used for unused variables
[deliverable/linux.git] / tools / perf / util / sort.c
index 0f5a0a496bc491e545d3bf30e8820163fbba61c6..0981bc7a29172a1d950236b0bbff7a76e6b2276c 100644 (file)
@@ -12,8 +12,6 @@ int           sort__branch_mode = -1; /* -1 = means not set */
 
 enum sort_type sort__first_dimension;
 
-char * field_sep;
-
 LIST_HEAD(hist_entry__sort_list);
 
 static int repsep_snprintf(char *bf, size_t size, const char *fmt, ...)
@@ -23,11 +21,11 @@ static int repsep_snprintf(char *bf, size_t size, const char *fmt, ...)
 
        va_start(ap, fmt);
        n = vsnprintf(bf, size, fmt, ap);
-       if (field_sep && n > 0) {
+       if (symbol_conf.field_sep && n > 0) {
                char *sep = bf;
 
                while (1) {
-                       sep = strchr(sep, *field_sep);
+                       sep = strchr(sep, *symbol_conf.field_sep);
                        if (sep == NULL)
                                break;
                        *sep = '.';
@@ -172,7 +170,7 @@ static int hist_entry__dso_snprintf(struct hist_entry *self, char *bf,
 
 static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym,
                                     u64 ip, char level, char *bf, size_t size,
-                                    unsigned int width __used)
+                                    unsigned int width __maybe_unused)
 {
        size_t ret = 0;
 
@@ -207,7 +205,8 @@ struct sort_entry sort_dso = {
 };
 
 static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
-                                   size_t size, unsigned int width __used)
+                                   size_t size,
+                                   unsigned int width __maybe_unused)
 {
        return _hist_entry__sym_snprintf(self->ms.map, self->ms.sym, self->ip,
                                         self->level, bf, size, width);
@@ -250,7 +249,8 @@ sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right)
 }
 
 static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf,
-                                  size_t size, unsigned int width __used)
+                                       size_t size,
+                                       unsigned int width __maybe_unused)
 {
        FILE *fp;
        char cmd[PATH_MAX + 2], *path = self->srcline, *nl;
@@ -399,7 +399,8 @@ sort__sym_to_cmp(struct hist_entry *left, struct hist_entry *right)
 }
 
 static int hist_entry__sym_from_snprintf(struct hist_entry *self, char *bf,
-                                   size_t size, unsigned int width __used)
+                                       size_t size,
+                                       unsigned int width __maybe_unused)
 {
        struct addr_map_symbol *from = &self->branch_info->from;
        return _hist_entry__sym_snprintf(from->map, from->sym, from->addr,
@@ -408,7 +409,8 @@ static int hist_entry__sym_from_snprintf(struct hist_entry *self, char *bf,
 }
 
 static int hist_entry__sym_to_snprintf(struct hist_entry *self, char *bf,
-                                   size_t size, unsigned int width __used)
+                                      size_t size,
+                                      unsigned int width __maybe_unused)
 {
        struct addr_map_symbol *to = &self->branch_info->to;
        return _hist_entry__sym_snprintf(to->map, to->sym, to->addr,
This page took 0.025904 seconds and 5 git commands to generate.