Re: [PATCH V4 1/2] x86/tdx: Eliminate duplicate code in tdx_clear_page()

From: Edgecombe, Rick P
Date: Wed Jul 23 2025 - 12:04:16 EST


On Wed, 2025-07-23 at 18:41 +0300, Adrian Hunter wrote:
> On 23/07/2025 18:33, Edgecombe, Rick P wrote:
> > On Wed, 2025-07-23 at 18:30 +0300, Adrian Hunter wrote:
> > > > The log should explain why it's ok to change now, with respect to the
> > > > reasoning
> > > > in the comment that is being removed.
> > >
> > > It makes more sense afterwards because then it can refer to the
> > > functional change:
> >
> > Cleanups first is the norm. This doesn't seem like a special situation. Did you
> > try to re-arrange it?
>
> Patch 1 only introduced "quirk" terminology to save touching the
> same lines of code in patch 2 and distracting from its main purpose,
> but the quirk functionality is not added until patch 2, so the
> tidy-up only really makes sense afterwards.

No. It could be easily done upfront. Just rename everything and remove the
comment if you want to go with the rename option. Justification: Make code
readable instead of having comments to explain confusing code. Then put a little
bit saying that future changes will make it optional so it's nice to have the
name.