[PATCH i-g-t 24/28] xe/oa: Fix invalid escape warnings

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Thu Jun 20 23:43:09 UTC 2024


On Thu, Jun 20, 2024 at 01:00:49PM -0700, Ashutosh Dixit wrote:
>From: José Roberto de Souza <jose.souza at intel.com>
>
>Fix this warnings:
>SyntaxWarning: invalid escape sequence '\
>
>Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

>---
> lib/xe/oa-configs/codegen.py           | 12 ++++++------
> lib/xe/oa-configs/mdapi-xml-convert.py |  2 +-
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/lib/xe/oa-configs/codegen.py b/lib/xe/oa-configs/codegen.py
>index 9a7d57a33e..f078ef9498 100644
>--- a/lib/xe/oa-configs/codegen.py
>+++ b/lib/xe/oa-configs/codegen.py
>@@ -162,13 +162,13 @@ hw_vars_mapping = {
> }
>
> def is_hw_var(name):
>-    m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
>+    m = re.search(r'\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
>     if m:
>         return True
>-    m = re.search('\$GtSlice([0-9]+)$', name)
>+    m = re.search(r'\$GtSlice([0-9]+)$', name)
>     if m:
>         return True
>-    m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
>+    m = re.search(r'\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
>     if m:
>         return True
>     return name in hw_vars_mapping
>@@ -338,13 +338,13 @@ class Gen:
>             return self.hw_vars[name]['c']
>         if name in set.counter_vars:
>             return set.read_funcs[name] + "(perf, metric_set, accumulator)"
>-        m = re.search('\$GtSlice([0-9]+)$', name)
>+        m = re.search(r'\$GtSlice([0-9]+)$', name)
>         if m:
>             return 'intel_xe_perf_devinfo_slice_available(&perf->devinfo, {0})'.format(m.group(1))
>-        m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
>+        m = re.search(r'\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
>         if m:
>             return 'intel_xe_perf_devinfo_subslice_available(&perf->devinfo, {0}, {1})'.format(m.group(1), m.group(2))
>-        m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
>+        m = re.search(r'\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
>         if m:
>             return 'intel_xe_perf_devinfo_subslice_available(&perf->devinfo, {0}, {1})'.format(m.group(1), m.group(2))
>         return None
>diff --git a/lib/xe/oa-configs/mdapi-xml-convert.py b/lib/xe/oa-configs/mdapi-xml-convert.py
>index ab4747ddd1..575b53e955 100755
>--- a/lib/xe/oa-configs/mdapi-xml-convert.py
>+++ b/lib/xe/oa-configs/mdapi-xml-convert.py
>@@ -228,7 +228,7 @@ counter_blacklist = {
>
> def underscore(name):
>     s = re.sub('MHz', 'Mhz', name)
>-    s = re.sub('\.', '_', s)
>+    s = re.sub(r'\.', '_', s)
>     s = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', s)
>     s = re.sub('#', '_', s)
>     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s).lower()
>-- 
>2.41.0
>


More information about the igt-dev mailing list