Re: [PATCH v4 09/10] x86/virt/tdx: Use early returns in get_tdx_sys_info()
From: Binbin Wu
Date: Tue Oct 13 2026 - 07:18:11 EST
On 10/12/2026 5:47 PM, Chao Gao wrote:
> get_tdx_sys_info() was generated by a script. It chains its metadata reads
> with:
>
> ret = ret ?: get_tdx_sys_info_foo(...);
>
> The function is maintained by hand now. Use conventional early returns
> instead.
>
> Print the module version only after its metadata has been read
> successfully. The "ret ?:" chain has no early exit, so the pr_info() after
> the version read prints a partially read or all-zero version when that read
> fails. That is harmless, but once every other read returns on error, a
> print after a failed read would look like a bug.
>
> AI was used under supervision to review code and workshop logs.
>
> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
> Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>