From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A96B3BED4A for ; Sat, 9 May 2026 18:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778349726; cv=none; b=aZ/MjiOZ2cP3W7Y0TDJ0nOQkpFyUEJW6vbod9EF+lgb3hBF6S7Y7Nr9N6XVS77pNspyv4Dq4CmGHE9kvEwsnrCYTv3xSb9+Dbgoa+1a4kTLwdhGu2fRjby+vCrPqu6gn9E0mixgzHeoXCDoo4A818oekUskyM9pwhExFOBp+2b0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778349726; c=relaxed/simple; bh=8Wdfg2SJ3gRskIF0owADzPtFvL3MSIE8LIK6AUNp5IA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=STfvqmxU4ZEC3WKmD0EQbSnQYTZEO1IYiwzVU7RhpAeHGu9ulzo/ec1LdKw2DGefHi2mjLX5sOx4CDnXDbP3qusMOHtA3D79+B4JhBh2mahr0PUqHk1IiAVtySGMz0PcUdy4yitR7+1VMhpj4YwCaIjjX3IKiQwFBR+hx6dzzOU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PjQnRyf8; arc=none smtp.client-ip=74.125.82.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PjQnRyf8" Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-12c45281a06so5132022c88.1 for ; Sat, 09 May 2026 11:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778349724; x=1778954524; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YaEPK4/H/C1sXiusKGjDTH5/2nNAukTV1mTuI6SInxw=; b=PjQnRyf8uGXCdxyLpLzUYLk1INjce59uTUcdHZVzB4gR2/NA7OiViRY6tJYME0Txkx Y7+2G2d1JCxQK4G896n2g3/laSqnpyw1AeMsfwTFkzvxRREns569KJp9Lx+LdyCjlkzo 6F/0EMdMjblbGIC5Ai3PuDfAr+3v6ONLfw8wEv1D0cQOBSV6fMj6nbJ4doOp40VuWRlL wVBURaC3ZMRbQpmqI6aooALa1B4bnWQMOvpiPUR48BfKsQ3O+9TPfYcaLgqaPbZ5+J62 AoFxXJUSSasQROAOb/FKOrot7WtA9k4GCvC2bEY+ATP1ClTz3tr/e198Skxp8IH+QUvk 1n2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778349724; x=1778954524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YaEPK4/H/C1sXiusKGjDTH5/2nNAukTV1mTuI6SInxw=; b=q5PFMHcKgT4jFpZMHRH1OyoIJeg2we3ZCQb6Um1FENaRkfIXSAaak6cMZwUQeV0SMl XVgu4QOfyLCBht+vZuG7QixIrUziv2JcoFsjE0pLMp6FusDJGbMGnexcaDCWItJ0ZLNA b7PbPQWA3N6cHBH1CM/v+5uBUzjBmqxW6lPLRPJZyGkOocUwfefyIJHO0h/z65MA0QPt gLndOvVe3G1O0xMXDhukoPGa7JdjUlDzg1J/aoQ03ucIDcMQhspzgg1k3nYa8nzoWLwx ETG5SQhw8Rtw7lRlWRSXW7y7tL0pbHQeqDTYFz9yfegGLAXYtdaVwN9KXW1angMkpzT/ Hs6Q== X-Forwarded-Encrypted: i=1; AFNElJ8p8UjXWVBjRc1UuxABYk879iuUD+PnKlcHdmHk/Miat+Qe0ziR+uE7OAqGADHl8UcWJSQzBYuqLdX7QdI=@vger.kernel.org X-Gm-Message-State: AOJu0YyZe/NkHZzxPsVKyTPTzSfTi+uLEgkacu/8161Zd3HHpkZhm8uK OneaatlT/6WMqOu4cFsMp07RPN8myn1CnJdgu1gsKngno8cwD5zEsfMo X-Gm-Gg: Acq92OE/9PpRJg7+6e7pt90bIiDiOj45sDr+iZwkceF1FhQiEHgvLAViCP1lWHeTgGN agvF/nWmXKTfJsvM4Mbkrl1+Xtluoa4/VQtk8I0qr/dANYxzxTj1NQcAGsQVbobijmQUWrAcdC5 fpZEs648I4HQinsD3y79/TOAoAeLtwRkuQO1wX0GPb5+pH1zlnuEvWxyGC6Bv4WAMTbxvfWT9lr uwC4t268UebOKvOa58hAeS41e3vLQ36pnFCJcZigKe3MP54mkV7BuhgDIVPIhcfCLVlaIRuJ7Fm 3Dk8TngLHBmd0ALTQguJRFolrzcaBBzE5VIcwBSkh6N98hXKhBaWBOXj8ZsyDlzf0Ews78cp8D4 g0aaiBncgOclfDeHbbBgAvmSBw80E1rBzkSFWCRK4pLyYZOIWj0fTUxP6bzdqK4OgRj3Sr+7Fbd DDNQKAHDZ/erzBW5v9y8KMRfEu8W7FBkMFNHimNxHTGX4ycaypUynnpBGJn8xCdEyFhNt3z29m X-Received: by 2002:a05:7022:f005:b0:12c:8b9:7208 with SMTP id a92af1059eb24-1318e811fffmr8395727c88.26.1778349724444; Sat, 09 May 2026 11:02:04 -0700 (PDT) Received: from rawhide.lvn.broadcom.net ([192.19.161.250]) by smtp.googlemail.com with ESMTPSA id a92af1059eb24-1327821fd00sm8979500c88.8.2026.05.09.11.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 11:02:04 -0700 (PDT) From: Shreenidhi Shedi To: gregkh@linuxfoundation.org, acme@kernel.org, linux@treblig.org, mikhail.v.gavrilov@gmail.com Cc: yesshedi@gmail.com, linux-kernel@vger.kernel.org, Ian Rogers , Namhyung Kim Subject: [PATCH v1 08/18] perf tools: Remove unused color_fwrite_lines Date: Sat, 9 May 2026 23:05:49 +0530 Message-ID: <20260509173559.10999-9-yesshedi@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260509173559.10999-1-yesshedi@gmail.com> References: <20260509173559.10999-1-yesshedi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Dr. David Alan Gilbert" commit c7c1bb78f3eec716bc35f58d74592331cc3281b2 upstream color_fwrite_lines() was added by 2009's commit 8fc0321f1ad0 ("perf_counter tools: Add color terminal output support") but has never been used. Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20241009003938.254936-1-linux@treblig.org Signed-off-by: Namhyung Kim Signed-off-by: Shreenidhi Shedi --- tools/perf/util/color.c | 28 ---------------------------- tools/perf/util/color.h | 1 - 2 files changed, 29 deletions(-) diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c index bffbdd216a6a..e51f0a676a22 100644 --- a/tools/perf/util/color.c +++ b/tools/perf/util/color.c @@ -93,34 +93,6 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...) return r; } -/* - * This function splits the buffer by newlines and colors the lines individually. - * - * Returns 0 on success. - */ -int color_fwrite_lines(FILE *fp, const char *color, - size_t count, const char *buf) -{ - if (!*color) - return fwrite(buf, count, 1, fp) != 1; - - while (count) { - char *p = memchr(buf, '\n', count); - - if (p != buf && (fputs(color, fp) < 0 || - fwrite(buf, p ? (size_t)(p - buf) : count, 1, fp) != 1 || - fputs(PERF_COLOR_RESET, fp) < 0)) - return -1; - if (!p) - return 0; - if (fputc('\n', fp) < 0) - return -1; - count -= p + 1 - buf; - buf = p + 1; - } - return 0; -} - const char *get_percent_color(double percent) { const char *color = PERF_COLOR_NORMAL; diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h index 01f7bed21c9b..aecf56dae73f 100644 --- a/tools/perf/util/color.h +++ b/tools/perf/util/color.h @@ -39,7 +39,6 @@ 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); int color_fprintf(FILE *fp, const char *color, const char *fmt, ...); int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...); -int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); int value_color_snprintf(char *bf, size_t size, const char *fmt, double value); int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...); int percent_color_len_snprintf(char *bf, size_t size, const char *fmt, ...); -- 2.54.0