From: Simon Glass Date: Thu, 10 Apr 2025 12:43:02 +0000 (-0600) Subject: binman: Drop algo check in CheckSetHashValue() X-Git-Tag: v2025.07-rc1~70^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=702b7a3e2eb49b144936e061c0107518544c4b1a;p=pandora-u-boot.git binman: Drop algo check in CheckSetHashValue() The CheckAddHashValue() function is always called before this one, so the algorithm check is never used. Replace it with an assert to avoid a coverage error. Signed-off-by: Simon Glass --- diff --git a/tools/binman/state.py b/tools/binman/state.py index 6772d3678fe..f4d885c772a 100644 --- a/tools/binman/state.py +++ b/tools/binman/state.py @@ -411,8 +411,7 @@ def CheckSetHashValue(node, get_data_func): m = hashlib.sha256() m.update(get_data_func()) data = m.digest() - if data is None: - raise ValueError(f"Node '{node.path}': Unknown hash algorithm '{algo}'") + assert data for n in GetUpdateNodes(hash_node): n.SetData('value', data)