From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B9A0394789 for ; Thu, 14 May 2026 18:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778784601; cv=none; b=LsBIDHhTgEWGc4KdTb4CaVZk7CPA+78Jb8xCPdzsKB4qJXSTh7mvpoFXGcFaUUxC5wk79hkvdiABQsxsjUj2JwDvEsoRHvCybMJIT/ED0kIyvAylSWvcBsqGHtslel1tXtVt/PTV4how4KHbnn0EBDdNNy5918wTFHRqM5QHtB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778784601; c=relaxed/simple; bh=V88+aVo72VGjndsAa0sws9Ox0ATBFTbHOp9qoVBUZsg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nEdYY+nHhkMG0Psjmfsa8WKWrkbi6sUntTaPDwBoIvC/2FRO6z9vtUICB5VYsiC7R+K1b+v1TCdgMQd1mFenti7jqyBCSRYDHlA2IL4Rw/U4etJ5BDwhr5wPjyZpRs2ipT63E2zQeqAr4UpGEyXUUggiCKpxZTCn6cuwCpSpkuU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fO2RtGVx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fO2RtGVx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEDD2C2BCB7; Thu, 14 May 2026 18:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778784600; bh=V88+aVo72VGjndsAa0sws9Ox0ATBFTbHOp9qoVBUZsg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fO2RtGVxyLWqHy0p/63SHCVDC06/mKFZJKnbu2sFkQ1QUyB0WkMMMm7NhD+jIou4o s3IcYPrLS5zf+GDIAmr0jyWUYvsZ4EfSBihDfFpuB0312U/c8L+65/YZ+MXgtLWGGo STyX99YBLvO/3deVZH//yzsd7VJqHijDibyvign4iIQPo+f4jPL26BTZA/nhAL4hgd eLjHfUaz8XW2ZAQx9EnwNxwjlqi/acfQt3MYUIawIqXGvPqxR+mlj73GDejPr6I5Af M8M/VhqEilWQp+WUzWdgUfLFUu0H+nPQy+hJlUAjM74aELHiMFJHvVBnxsIHTnuco8 RcSbujEH5UCkw== Date: Thu, 14 May 2026 20:49:56 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet Cc: Yash Rai , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage() Message-ID: <20260514204956.312927f7@foz.lan> In-Reply-To: <87fr3uufz3.fsf@trenco.lwn.net> References: <20260514134952.62362-1-yash2154rai@gmail.com> <87fr3uufz3.fsf@trenco.lwn.net> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 14 May 2026 10:13:20 -0600 Jonathan Corbet wrote: > Yash Rai writes: > > > The parameter 'width' in _fill_text() and 'usage' and 'groups' > > in _format_usage() are not used in enrich_formatter.py. > > > > This is a cleanup with no functional change. > > > > Signed-off-by: Yash Rai > > --- > > tools/lib/python/kdoc/enrich_formatter.py | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/tools/lib/python/kdoc/enrich_formatter.py b/tools/lib/python/kdoc/enrich_formatter.py > > index d1be4e5e1962..7e0f09f5ccea 100644 > > --- a/tools/lib/python/kdoc/enrich_formatter.py > > +++ b/tools/lib/python/kdoc/enrich_formatter.py > > @@ -42,14 +42,14 @@ class EnrichFormatter(argparse.HelpFormatter): > > lambda m: f'\033[1m{m.group(1)}\033[0m', text) > > return text > > > > - def _fill_text(self, text, width, indent): > > + def _fill_text(self, text, indent): > > """ > > Enrich descriptions with markups on it. > > """ > > enriched = self.enrich_text(text) > > return "\n".join(indent + line for line in enriched.splitlines()) > > > > - def _format_usage(self, usage, actions, groups, prefix): > > + def _format_usage(self, actions, prefix): > > """ > > Enrich positional arguments at usage: line. > > """ > > Looking at this patch, my immediate response is that you didn't change > any callers. That is ... because there are no callers. So, rather > than tweak the argument lists, is there a reason to not just delete > these functions altogether? Such functions are indirectly called by argparse.HelpFormatter. You may remove the unused arguments with either * (positional args) and/or ** (keyword arguments), to avoid python errors/warnings, but if you drop the functions, EnrichFormatter won't be doing what it is expected. Thanks, Mauro