From 231c4e36de515d6a7a1980613f0343594bec716d Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 31 May 2023 18:21:24 +0000 Subject: [PATCH] xtensa-build-zephyr.py: remove `default_rimage_key` dead code We used to provide the `default_rimage_key` in two places: 1) as a default `RIMAGE_KEY` attribute (newer `otc_private_key_3k`) 2) as an explicit `else` clause that was never run because of 1) (older `otc_private_key`) Remove the redundant `else` clause in 2); it became dead code. This simplifies the code and makes the script ready for the day when the key argument will be optional for rimage (more about this in https://github.com/zephyrproject-rtos/zephyr/pull/58356) Signed-off-by: Marc Herbert --- scripts/xtensa-build-zephyr.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 3e07ac2c1..ba0fdccba 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -60,7 +60,6 @@ VERSION = version.Version("2.0.0") # Constant value resolves SOF_TOP directory as: "this script directory/.." SOF_TOP = pathlib.Path(__file__).parents[1].resolve() west_top = pathlib.Path(SOF_TOP, "..").resolve() -default_rimage_key = pathlib.Path(SOF_TOP, "keys", "otc_private_key.pem") sof_fw_version = None @@ -587,17 +586,16 @@ def rimage_options(platform_dict): if args.verbose > 0: opts.append(("-v",) * args.verbose) - signing_key = "" + signing_key = None if args.key: key_path = pathlib.Path(args.key) assert key_path.exists(), f"{key_path} not found" signing_key = key_path.resolve() elif "RIMAGE_KEY" in platform_dict: signing_key = platform_dict["RIMAGE_KEY"] - else: - signing_key = default_rimage_key - opts.append(("-k", str(signing_key))) + if signing_key is not None: + opts.append(("-k", str(signing_key))) sof_fw_vers = get_sof_version()