From nobody Sat Oct 4 22:37:57 2025 Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) (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 5DE652FE594; Tue, 12 Aug 2025 19:57:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.79.88.28 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755028679; cv=none; b=fTQajLsdV0j3jdKk9AB1gUxXMECsGtCudGnzC4j95JaMlTTm+/VTgvjyJtRSqqnNEJm1OnInJs5BZPfvnAGHx5l9ONtvUZvY7V8VfZVkDe52JcJTXRwbpo5SQQauo9cWKgA1FoEP0A/RYERr75jcZUwkzNNfV8zxFkGZAA044eY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755028679; c=relaxed/simple; bh=4DU+J+rTTiyKivCXoJcHXntfdgk2NjPRT4WF82XNoM0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j6KiJmvgiOSRSty8BVYNGjAFdtZChQBVHZ2/IDaf7teyI7ug7fyDhmOGkUu8oZOudHYgqmMQXXzhVHYy94B5LIufJtrR89qcVyA2z8fnBZ3XJF2IoZggdQRb5RvU8zhrayDZt0OJj47vVP+8sRmtrdm8L2vXql3jm36gP4zCGpg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net; spf=pass smtp.mailfrom=lwn.net; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b=DqXh31bh; arc=none smtp.client-ip=45.79.88.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lwn.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lwn.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lwn.net header.i=@lwn.net header.b="DqXh31bh" DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net 70BB640ADC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1755028677; bh=JFF0dVs9V9DAAxQ+F/q3H9i8XQ3gen8VksquAovDBzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DqXh31bhIN7HXdtjAmSEKs2343cRTulew2dAG2lGie+JDZE69azM/ZusYVblZlvZi oNrnLyJI4OnmE0zGm+zVEo57gtPSWZPmOBZHNn8ZlJ4btlOhGaIozUCwsKEOl1R8PM rqNi/Oj+xpIyPkZ8oYfNM0JsFohpS5W5mUy+mAZbDYWranE25WF6IFTILWGPCRJVzl Dxk+WWUXCYUfeCUJNkh7aSp4dtidJKPJnoE6i2wNgrl40e3BlvZ/ASkdKrpgXRaMFC ZYWQFLiz1BRy6e/+sHMcPdyj9PXIRWMWhFpV8W8r9HXH6xrXej3j8+fYWlTtbwVAx0 6JLQVPdFouZjw== Received: from trenco.lwn.net (unknown [IPv6:2601:280:4600:2da9::1fe]) by ms.lwn.net (Postfix) with ESMTPA id 70BB640ADC; Tue, 12 Aug 2025 19:57:57 +0000 (UTC) From: Jonathan Corbet To: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Akira Yokosawa , Jonathan Corbet Subject: [PATCH 1/7] docs: kdoc: remove dead code Date: Tue, 12 Aug 2025 13:57:42 -0600 Message-ID: <20250812195748.124402-2-corbet@lwn.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812195748.124402-1-corbet@lwn.net> References: <20250812195748.124402-1-corbet@lwn.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" create_parameter_list() tests an argument against the same regex twice, in two different locations; remove the pointless extra tests and the never-executed error cases that go with them. Signed-off-by: Jonathan Corbet Reviewed-by: Mauro Carvalho Chehab --- scripts/lib/kdoc/kdoc_parser.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser= .py index 9e65948f8254..96e3fe4ec431 100644 --- a/scripts/lib/kdoc/kdoc_parser.py +++ b/scripts/lib/kdoc/kdoc_parser.py @@ -564,28 +564,18 @@ class KernelDoc: args.insert(0, first_arg.pop()) dtype =3D ' '.join(first_arg) =20 + bitfield_re =3D KernRe(r'(.*?):(\w+)') for param in args: - if KernRe(r'^(\*+)\s*(.*)').match(param): - r =3D KernRe(r'^(\*+)\s*(.*)') - if not r.match(param): - self.emit_msg(ln, f"Invalid param: {param}") - continue - - param =3D r.group(1) - + r =3D KernRe(r'^(\*+)\s*(.*)') + if r.match(param): self.push_parameter(ln, decl_type, r.group(2), f"{dtype} {r.group(1)}", arg, declaration_name) =20 - elif KernRe(r'(.*?):(\w+)').search(param): - r =3D KernRe(r'(.*?):(\w+)') - if not r.match(param): - self.emit_msg(ln, f"Invalid param: {param}") - continue - + elif bitfield_re.search(param): if dtype !=3D "": # Skip unnamed bit-fields - self.push_parameter(ln, decl_type, r.group(1), - f"{dtype}:{r.group(2)}", + self.push_parameter(ln, decl_type, bitfield_re= .group(1), + f"{dtype}:{bitfield_re.gro= up(2)}", arg, declaration_name) else: self.push_parameter(ln, decl_type, param, dtype, --=20 2.50.1