These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / tools / perf / util / color.c
index 55355b3..9b95654 100644 (file)
@@ -67,8 +67,9 @@ static int __color_vsnprintf(char *bf, size_t size, const char *color,
        return r;
 }
 
+/* Colors are not included in return value */
 static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
-               va_list args, const char *trail)
+               va_list args)
 {
        int r = 0;
 
@@ -83,12 +84,10 @@ static int __color_vfprintf(FILE *fp, const char *color, const char *fmt,
        }
 
        if (perf_use_color_default && *color)
-               r += fprintf(fp, "%s", color);
+               fprintf(fp, "%s", color);
        r += vfprintf(fp, fmt, args);
        if (perf_use_color_default && *color)
-               r += fprintf(fp, "%s", PERF_COLOR_RESET);
-       if (trail)
-               r += fprintf(fp, "%s", trail);
+               fprintf(fp, "%s", PERF_COLOR_RESET);
        return r;
 }
 
@@ -100,7 +99,7 @@ int color_vsnprintf(char *bf, size_t size, const char *color,
 
 int color_vfprintf(FILE *fp, const char *color, const char *fmt, va_list args)
 {
-       return __color_vfprintf(fp, color, fmt, args, NULL);
+       return __color_vfprintf(fp, color, fmt, args);
 }
 
 int color_snprintf(char *bf, size_t size, const char *color,
@@ -126,16 +125,6 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...)
        return r;
 }
 
-int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...)
-{
-       va_list args;
-       int r;
-       va_start(args, fmt);
-       r = __color_vfprintf(fp, color, fmt, args, "\n");
-       va_end(args);
-       return r;
-}
-
 /*
  * This function splits the buffer by newlines and colors the lines individually.
  *