misc: fix invalid escape sequence in python 3.12

Python 3.12 adds escape sequence check in strings, if it is invalid,
a SyntaxWarning will be given. Fix it by using raw string notation
in regular expressions, and changing comments in unused string literal
to normal comments.

Tracked-On: #8588
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Jiaqing Zhao
2024-05-06 08:23:57 +00:00
committed by acrnsi-robot
parent 69e4b936a8
commit 98e546e93d
3 changed files with 9 additions and 11 deletions

View File

@@ -148,7 +148,7 @@ def get_max_clos_mask(board_file):
if (len(rdt_res) == 0) or (len(rdt_res_clos_max) == 0):
return rdt_res, rdt_res_clos_max, rdt_res_mask_max
else:
return list(re.split(', |\s |,', rdt_res)), list(map(int, rdt_res_clos_max.split(','))), list(re.split(', |\s |,', rdt_res_mask_max))
return list(re.split(r', |\s |,', rdt_res)), list(map(int, rdt_res_clos_max.split(','))), list(re.split(r', |\s |,', rdt_res_mask_max))
def get_rootfs(config_file):
@@ -377,7 +377,7 @@ def get_p_state_index_from_ratio(ratio):
i = 0
closest_index = 1
for line in px_info:
l = re.search("0x(\w*)UL}", line)
l = re.search(r"0x(\w*)UL}", line)
if l != None:
state_ratio = int(l.group(1), 16) >> 8
if state_ratio <= ratio:

View File

@@ -72,10 +72,8 @@ LEGACY_VUART_IO_PORT_SIZE = 0x10
VMSIX_VBAR_SIZE = 4 * SIZE_K
# Constant for VIRT_ACPI_NVS_ADDR
"""
VIRT_ACPI_NVS_ADDR and PRE_RTVM_SW_SRAM_END_GPA
need to be consistant with the layout of hypervisor\arch\x86\guest\ve820.c
"""
# VIRT_ACPI_NVS_ADDR and PRE_RTVM_SW_SRAM_END_GPA
# need to be consistant with the layout of hypervisor\arch\x86\guest\ve820.c
VIRT_ACPI_NVS_ADDR = 0x7FF00000
RESERVED_NVS_AREA = 0xB0000