[PATCH i-g-t v2 2/6] tools/intel-gfx-fw-info: Annotate abstract method
Gustavo Sousa
gustavo.sousa at intel.com
Wed Aug 21 16:47:05 UTC 2024
Quoting Lucas De Marchi (2024-08-20 20:29:24-03:00)
>Make the FW an abstract class and annotate the decode() method.
>
>Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa 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