[PATCH i-g-t v3 2/6] tools/intel-gfx-fw-info: Annotate abstract method

Lucas De Marchi lucas.demarchi at intel.com
Mon Aug 26 15:26:52 UTC 2024


Make the FW an abstract class and annotate the decode() method.

Acked-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa at intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 tools/intel-gfx-fw-info | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/intel-gfx-fw-info b/tools/intel-gfx-fw-info
index 35555aab5..3105144b7 100755
--- a/tools/intel-gfx-fw-info
+++ b/tools/intel-gfx-fw-info
@@ -4,6 +4,7 @@
 #
 # Copyright (C) 2023 Intel Corporation
 
+import abc
 import argparse
 import logging
 import hashlib
@@ -103,10 +104,14 @@ def FIELD_GET(mask: int, value: int) -> int:
     return (value & mask) >> ffs(mask)
 
 
-class Fw:
+class Fw(abc.ABC):
     def __init__(self, fw):
         self.fw = fw
 
+    @abc.abstractmethod
+    def decode(self):
+        raise NotImplementedError()
+
 
 class FwCss(Fw):
     def decode(self):
-- 
2.43.0



More information about the igt-dev mailing list