+ Pierrick, because of name-check.

Hi, Marc-André

On 23/01/2026 01:49, [email protected] wrote:
From: Marc-André Lureau <[email protected]>

Signed-off-by: Marc-André Lureau <[email protected]>
---
  scripts/modinfo-generate.py | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)


Are you planning on adding a commit body to the message? I favor
type annotations in most cases including here, because it helps with
readability among other reasons; it would be nice if you included your
reasoning so that we could see more of it over time.

In any case, thanks for the patch and please take these:

Reviewed-by: Yodel Eldar <[email protected]>
Tested-by: Yodel Eldar <[email protected]>

Testing based on [email protected],
because building microblaze with --enable-modules is currently broken
on mainline. Pierrick's patch is already reviewed and will probably
land soon.

Commands used to test from build/:
$ ../configure --enable-modules --disable-docs
$ make -j$(nproc)
$ fd -0 -E '.cache' '^modinfo-|\.modinfo$' build/ | sort -z | xargs -0 cat | sha256sum

Ran the above both with and without your patch and confirmed that the
hashsum was identical on x86_64 Linux.

Thanks,
Yodel

diff --git a/scripts/modinfo-generate.py b/scripts/modinfo-generate.py
index aaf23544c46..5a8abcae5d3 100644
--- a/scripts/modinfo-generate.py
+++ b/scripts/modinfo-generate.py
@@ -2,14 +2,16 @@
import os
  import sys
+from typing import Optional
-def print_array(name, values):
+
+def print_array(name: str, values: list[str]) -> None:
      if len(values) == 0:
          return
      list = ", ".join(values)
      print("    .%s = ((const char*[]){ %s, NULL })," % (name, list))
-def parse_line(line):
+def parse_line(line: str) -> tuple[str, str]:
      kind = ""
      data = ""
      get_kind = False
@@ -31,7 +33,7 @@ def parse_line(line):
              continue
      return (kind, data)
-def generate(name, lines, enabled):
+def generate(name: str, lines: list[str], enabled: set[str]) -> 
Optional[set[str]]:
      arch = ""
      objs = []
      deps = []
@@ -68,17 +70,17 @@ def generate(name, lines, enabled):
      print("},{")
      return {dep.strip('" ') for dep in deps}
-def print_pre():
+def print_pre() -> None:
      print("/* generated by scripts/modinfo-generate.py */")
      print("#include \"qemu/osdep.h\"")
      print("#include \"qemu/module.h\"")
      print("const QemuModinfo qemu_modinfo[] = {{")
-def print_post():
+def print_post() -> None:
      print("    /* end of list */")
      print("}};")
-def main(args):
+def main(args: list[str]) -> None:
      if len(args) < 3 or args[0] != '--devices':
          print('Expected: modinfo-generate.py --devices '
                'config-device.mak [modinfo files]', file=sys.stderr)


Reply via email to