Re: [PATCH] x86/sgx: Use goto to remove redundant if check in sgx_encl_init

Thorsten Blum <[email protected]>
Newsgroups org.kernel.vger.linux-sgx,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 10. Dec 2025, at 16:32, Jarkko Sakkinen wrote:
> On Wed, Dec 10, 2025 at 02:00:35PM +0100, Thorsten Blum wrote:
>> Immediately break out of both loops when 'ret != SGX_UNMASKED_EVENT'
>> instead of checking for the same condition again in the outer loop.
>> 
>> Signed-off-by: Thorsten Blum <[email protected]>
>> ---
>> [...]
> 
> I don't think moving code around is very useful.

The patch doesn't actually move any code around, but it removes up to 50
(SGX_EINIT_SLEEP_COUNT) duplicate and therefore unnecessary if checks in
the outer for loop.

Thanks,
Thorsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.