From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CC79D3F099 for ; Wed, 28 Jan 2026 16:50:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EA40B409A6; Wed, 28 Jan 2026 16:50:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lY39_Nc4mfjV; Wed, 28 Jan 2026 16:50:46 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 53B6B409B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1769619046; bh=FI3JNqn/PwBUfddKV95KkjXDZhqbO97DZF1JPcy7RGM=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TnBHXC8WGef2NTS17H5GkO6hVU3hs3egTICDGCh3fQh3P2KWBNimpKBDxi1cJju/9 89/vpYoyLX9N+d3NmDQuWMltfbSpu/pSFV1GIC/4tMDbX2ScSSvzCxNfI1gHwOAlXC eZE/5UUNqvNBJhdRjgqAXIY2az9bRmIZhQvZh5sKXWtoHAl88eMc3sKFrFWoQutFS8 iVWL57c66/GIJ3/2MZOSUSnvceBeKliw8pX6Mpp4dpJL40z4cJPrKKFqmgwx2vani6 I30rONRA5GaljqrA2unLZpccAVPx14f6ccirQ1FQhKIGZRsLKlcu7jOPIbxjJJaqwJ WvWHAhqn5gKmA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 53B6B409B0; Wed, 28 Jan 2026 16:50:46 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id A3AC331D for ; Wed, 28 Jan 2026 16:50:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8520B400AD for ; Wed, 28 Jan 2026 16:50:37 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TeCnSEoYu4gN for ; Wed, 28 Jan 2026 16:50:36 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=mchehab+huawei@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 7B479400C5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7B479400C5 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp2.osuosl.org (Postfix) with ESMTPS id 7B479400C5 for ; Wed, 28 Jan 2026 16:50:36 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 5911F6012A; Wed, 28 Jan 2026 16:50:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6E3DC4AF09; Wed, 28 Jan 2026 16:50:34 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vl8kT-0000000DB1Q-0LmB; Wed, 28 Jan 2026 17:50:33 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Date: Wed, 28 Jan 2026 17:50:13 +0100 Message-ID: <934f61b22277dd5575c77edde96dfa7a98c8d79b.1769617841.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769619034; bh=LaLUXoY/KS6WIRVp9iorgFncFjJ1rGpIWKLw4YbQxJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MAdy0Pn4PxMBzSJDBYcEr2AP0/IM48hX+BjDM49cjB/+BzdvguBKB2hNMO1u0NqP7 4SmciDVlxhTVqqriuOudMQi8GYQbH4Xy0RZ0FmgmzswS+auffCPCrYdLKDS1NaSD8V 2f2lJpVto3DW99L5agFfQJu8lSzSfceYwuKR83ClL0nOQ5H3jD4Fh1gAy0DTjXfkFO OcN+1L4D8BImAEk/VWN1ssCz4LI1sPJuPapJwM7w+vJJ+NGbhRpboig/+g9Ya/p4Ul jFpaZiVxoBtbUeuQJHfbrQAhXUBzEsUIClExRvCwVqczKtkqrxG1hsFn/MeGXBVUWn j+dwWzxZgAhBQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=MAdy0Pn4 Subject: [Intel-wired-lan] [PATCH v2 15/25] docs: kdoc_re: properly handle strings and escape chars on it X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" The logic inside NestedMatch currently doesn't consider that function arguments may have chars and strings, which may eventually contain delimiters. Add logic to handle strings and escape characters on them. Signed-off-by: Mauro Carvalho Chehab --- tools/lib/python/kdoc/kdoc_re.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_re.py index a0402c065d3a..1861799f1966 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -195,6 +195,8 @@ class NestedMatch: for match_re in regex.finditer(line): start = match_re.start() offset = match_re.end() + string_char = None + escape = False d = line[offset - 1] if d not in self.DELIMITER_PAIRS: @@ -208,6 +210,22 @@ class NestedMatch: d = line[pos] + if escape: + escape = False + continue + + if string_char: + if d == '\\': + escape = True + elif d == string_char: + string_char = None + + continue + + if d in ('"', "'"): + string_char = d + continue + if d in self.DELIMITER_PAIRS: end = self.DELIMITER_PAIRS[d] -- 2.52.0