[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea72062f-e529-4b46-801b-b230571a1c62@intel.com>
Date: Wed, 26 Mar 2025 11:43:40 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Chao Gao <chao.gao@...el.com>
CC: <linux-kernel@...r.kernel.org>, <x86@...nel.org>, <tglx@...utronix.de>,
<mingo@...hat.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
<colinmitchell@...gle.com>
Subject: Re: [PATCH v2a 4/6] x86/microcode/intel: Implement staging handler
On 3/26/2025 1:34 AM, Chao Gao wrote:
>> +
>> + /* Reset tracking variables */
>> + ss->offset = 0;
>> + ss->bytes_sent = 0;
>
> Nit: no need to reset them, as
>
>> + struct staging_state ss = {};
>
> in do_stage() will zero the whole structure.
I initially wanted to explicitly highlight where these variables are
reset, but you’re right — in practice, they can be removed.
> why send_data_chunk() and fetch_next_offset() return a boolean instead of
> an error or ucode_state?
>
> Using the return value to indicate just success or failure, while relying
> on another variable to report detailed error/state, seems a bit clumsy to
> me.
The error state is interpreted at the call site, where the final result
is returned to the caller.
At the end of each step, all the loop needs to decide is whether to
continue or break, which naturally fits a boolean return. I don’t see a
strong reason to change this approach.
Thanks,
Chang
Powered by blists - more mailing lists