From 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Thu, 16 May 2024 03:11:33 +0000 Subject: [PATCH] AX88772C_eeprom and ax8872c build together --- kernel/tools/perf/util/color.c | 42 ++---------------------------------------- 1 files changed, 2 insertions(+), 40 deletions(-) diff --git a/kernel/tools/perf/util/color.c b/kernel/tools/perf/util/color.c index 39e628b..bffbdd2 100644 --- a/kernel/tools/perf/util/color.c +++ b/kernel/tools/perf/util/color.c @@ -1,52 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> -#include "cache.h" -#include "config.h" +#include <subcmd/pager.h> #include <stdlib.h> #include <stdio.h> +#include <string.h> #include "color.h" #include <math.h> #include <unistd.h> int perf_use_color_default = -1; - -int perf_config_colorbool(const char *var, const char *value, int stdout_is_tty) -{ - if (value) { - if (!strcasecmp(value, "never")) - return 0; - if (!strcasecmp(value, "always")) - return 1; - if (!strcasecmp(value, "auto")) - goto auto_color; - } - - /* Missing or explicit false to turn off colorization */ - if (!perf_config_bool(var, value)) - return 0; - - /* any normal truth value defaults to 'auto' */ - auto_color: - if (stdout_is_tty < 0) - stdout_is_tty = isatty(1); - if (stdout_is_tty || pager_in_use()) { - char *term = getenv("TERM"); - if (term && strcmp(term, "dumb")) - return 1; - } - return 0; -} - -int perf_color_default_config(const char *var, const char *value, - void *cb __maybe_unused) -{ - if (!strcmp(var, "color.ui")) { - perf_use_color_default = perf_config_colorbool(var, value, -1); - return 0; - } - - return 0; -} static int __color_vsnprintf(char *bf, size_t size, const char *color, const char *fmt, va_list args, const char *trail) -- Gitblit v1.6.2