summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_re.py
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-12 14:08:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-12 14:08:35 +0300
commit4a12f38e23d10a5dbad6cce0abaadd10e5a1aa68 (patch)
tree533208f5479c17b9a7c162a425a967c7a7edf46b /scripts/lib/kdoc/kdoc_re.py
parent0d2f2f4f27694a2214701e7482ab7599ce4e5e77 (diff)
parent449d48b1b99fdaa076166e200132705ac2bee711 (diff)
downloadlinux-4a12f38e23d10a5dbad6cce0abaadd10e5a1aa68.tar.xz
Merge v6.17.2
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_re.py')
-rw-r--r--scripts/lib/kdoc/kdoc_re.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/scripts/lib/kdoc/kdoc_re.py b/scripts/lib/kdoc/kdoc_re.py
index e81695b273bf..612223e1e723 100644
--- a/scripts/lib/kdoc/kdoc_re.py
+++ b/scripts/lib/kdoc/kdoc_re.py
@@ -29,12 +29,9 @@ class KernRe:
"""
Adds a new regex or re-use it from the cache.
"""
-
- if string in re_cache:
- self.regex = re_cache[string]
- else:
+ self.regex = re_cache.get(string, None)
+ if not self.regex:
self.regex = re.compile(string, flags=flags)
-
if self.cache:
re_cache[string] = self.regex