[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] xen/x86: Fix Syntax warning in gen-cpuid.py
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Fri, 26 Apr 2024 00:07:16 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+xRYTy8jRKTfWnehr4ShnCN0JVJhIZe/kzc3UMDV5SY=; b=hk8yzOCu2L0v28d3lBgOLdCUrBzf8czor4EsIBZUrSg7P3rWXfKMIabmXERqA94Xwz0vGShMitUaaMyiKrFrY6n/MsCIURtDav4JHBUQtVKJ8co0Fnr/CT9bojsxp82A4DnD1P8FH5Yu8wtv5vpIEkjQQaxjMjwXPOvs6GMu2T4d67DF5BGwv+gM6pCA6+fy9mxo/gIprq9pk0PT19DInZo55y/nkWHwSAwRjPMk4EezglxiSP65IrHGfPkFliyAf6vHVQm6jrWVFa+mLOTu8fWEA2zbEElhf0P9FJeBVqCqExv5AYGERCIHnZaTc7va6c3q/KygPce7x+nZORM5eg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kHtMGRB8L9LtTXkIEP3clluLnXyYPqSqNAzqLR6f1GGfneDC7+yQxaXg6Mh/Iv2BboaBnPO3d9P+7O/woIoC9VAGJbTVPp27fbsVNBt4ISFcml5X3QTSo0d6xYKrUdc/8jZo1DLLbzBXMoMUfbimM4V0jF6Rw4PqNZYf03Z9zGvFomEBVk8tCKIplPNlgiynrTZz0GX0pQ9yWHLdaVj4dYJMwqJeIU1eLpisZ36/2dEKSpBcclvb7f2HyreuGMuQi0WFvjEp63itVV5vGUajVxFMCigvymlPRYT422TQRXnpLUxoPg+drMf9GYOqmWg9nMmIZYBJVZsob7q4req+bQ==
- Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 26 Apr 2024 18:55:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Python 3.12.2 warns:
xen/tools/gen-cpuid.py:50: SyntaxWarning: invalid escape sequence '\s'
"\s+([\s\d]+\*[\s\d]+\+[\s\d]+)\)"
xen/tools/gen-cpuid.py:51: SyntaxWarning: invalid escape sequence '\s'
"\s+/\*([\w!]*) .*$")
Specify the strings as raw strings so '\s' is read as literal '\' + 's'.
This avoids escaping all the '\'s in the strings.
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
xen/tools/gen-cpuid.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index bf3f9ec01e..dadeb33080 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -47,8 +47,8 @@ def parse_definitions(state):
"""
feat_regex = re.compile(
r"^XEN_CPUFEATURE\(([A-Z0-9_]+),"
- "\s+([\s\d]+\*[\s\d]+\+[\s\d]+)\)"
- "\s+/\*([\w!]*) .*$")
+ r"\s+([\s\d]+\*[\s\d]+\+[\s\d]+)\)"
+ r"\s+/\*([\w!]*) .*$")
word_regex = re.compile(
r"^/\* .* word (\d*) \*/$")
--
2.44.0
|