]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Adjust show_toolchain_prefix() to not return
authorSimon Glass <sjg@chromium.org>
Wed, 19 Jul 2023 23:48:56 +0000 (17:48 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 24 Jul 2023 15:34:11 +0000 (09:34 -0600)
This function does not need to return. Simplify the code by exiting
immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/control.py

index f30b8beae8298b11b6b6d7fd90ac9e15b7461202..5327929444b24245c0ca869f30de30d6dc544fc1 100644 (file)
@@ -121,10 +121,9 @@ def show_toolchain_prefix(brds, toolchains):
     for brd in board_selected.values():
         tc_set.add(toolchains.Select(brd.arch))
     if len(tc_set) != 1:
-        return 'Supplied boards must share one toolchain'
+        sys.exit('Supplied boards must share one toolchain')
     tchain = tc_set.pop()
     print(tchain.GetEnvArgs(toolchain.VAR_CROSS_COMPILE))
-    return None
 
 def get_allow_missing(opt_allow, opt_no_allow, num_selected, has_branch):
     """Figure out whether to allow external blobs
@@ -557,9 +556,7 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
         brds, args, col, options.boards, options.exclude)
 
     if options.print_prefix:
-        err = show_toolchain_prefix(brds, toolchains)
-        if err:
-            sys.exit(col.build(col.RED, err))
+        show_toolchain_prefix(brds, toolchains)
         return 0
 
     series = determine_series(selected, col, git_dir, options.count,