[PATCH i-g-t 1/4] tools/intel-gfx-fw-info: Annotate abstract method
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Aug 20 17:35:43 UTC 2024
Hi Lucas,
On 2024-08-19 at 12:55:57 -0700, Lucas De Marchi wrote:
> Make the FW an abstract class and annotate the decode() method.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Please use pylint and address few issues like Unnecessary semicolon
or Unused variable 'i' (unused-variable)
Last line from pylint:
Your code has been rated at 6.75/10 (previous run: 6.75/10, +0.00)
I am not python expert so feel free to ignore this.
Regards,
Kamil
> ---
> 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 b0d41bbae..5156c724c 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