Hi Sergio,

On 2026-07-28T11:35:30, Sergio Prado <[email protected]> wrote:
> binman: ti_secure: drop the redundant keyfile re-read
>
> Entry_ti_secure and Entry_ti_secure_rom both call super().ReadNode() and
> then read the 'keyfile' entry argument a second time, with exactly the
> call that Entry_x509_cert.ReadNode() has already made. The second read is
> pure duplication, and it means anything the parent does to
> self.key_fname is silently discarded.
>
> Drop it, so that the subclasses use the value their parent decided on,
> and drop the EntryArg import which becomes unused.
>
> No functional change.
>
> Signed-off-by: Sergio Prado <[email protected]>
>
> tools/binman/etype/ti_secure.py     | 3 ---
>  tools/binman/etype/ti_secure_rom.py | 3 ---
>  2 files changed, 6 deletions(-)

> diff --git a/tools/binman/etype/ti_secure_rom.py 
> b/tools/binman/etype/ti_secure_rom.py
> @@ -71,8 +70,6 @@ class Entry_ti_secure_rom(Entry_x509_cert):
>          self.sha = fdt_util.GetInt(self._node, 'sha', 512)
>          self.core = fdt_util.GetString(self._node, 'core', 'secure')
>          self.bootcore_opts = fdt_util.GetInt(self._node, 'core-opts')
> -        self.key_fname = self.GetEntryArgsOrProps([
> -            EntryArg('keyfile', str)], required=True)[0]

BTW Entry_ti_secure_rom.ReadNode() also re-reads 'sw-rev' with the
parent's default (line 70) - same pattern. Folding it in would leave
no redundant re-reads at all. Could be a follow-up perhaps?

Reviewed-by: Simon Glass <[email protected]>

Regards,
Simon

Reply via email to