On Tue, 2026-07-07 at 19:07 -0700, Rick Edgecombe wrote:
quoted
I think you can avoid the comment altogether in that case.
I don't think it removes the need for a comment. The point is if
tdx_supports_dynamic_pamt() is not supported. The comment should be more about
"why", than what the code does, right?
How about:
if (ret)
return ret;
/*
* The kernel supports using TDX without Dynamic PAMT, so
* avoid reporting failure if it's not supported.
*/
if (tdx_supports_dynamic_pamt(sysinfo))
ret = get_tdx_sys_info_tdmr_dpamt(&sysinfo->tdmr);
return ret;
Actually this really stands out from the autogenerated code now, how about:
/*
* The kernel supports using TDX without Dynamic PAMT, so
* avoid reporting failure if it's not supported.
*/
if (!ret && tdx_supports_dynamic_pamt(sysinfo))
ret = get_tdx_sys_info_tdmr_dpamt(&sysinfo->tdmr);
It why-ifys the comment more, but only gently moves from the auto-generated
patterns.