From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5E55205E3B for ; Wed, 10 Dec 2025 15:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765381727; cv=none; b=WReG+ka7tTpbaizxwPhBR+48lnMhuDtkRQinr0+/fNNRuf5wvTMMr0GDFcIwsizEPhqwLRRtIytUHl+FLD6o9yqorkDPaUSUIopBEOVaqCa8MRhSK8o+IHntlcauOBi9gv1Zr70R8ez8qMQbsqh77kyq9qVvq03/OiSPdxJe4Tk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765381727; c=relaxed/simple; bh=I8pGY7uzM1bKEYtDArmBLBtQqtLnX40OIsWGpYckGhU=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=cNAWUrRJG6XC6Qcx1vZr7TrNlE0Zvmg2k8SBlPCOae2CzB9TEVsPUrZz52l3xCuwXZHeSXk57qgN/nLbQE2ldS60OoqI2R5d+1XbZFKmarKzve7CdlDwgnrMMkMiR1BnaW+Y7j4tGphuOGu8Ep4daqeL5EUKa/vq1M4Ujwf/4n0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Enr000sz; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Enr000sz" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1765381723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CmSmsy9of/FsvpRFX//F0lS8YsK2NLUj1UdR3A2yZ1k=; b=Enr000sz8Cp0gCHry3D2ddxeOyQ4Bmq/qUQPHuLEoerJA4p3U2UfmrUhYpEhz22Go3hfcd KIIGbpFBwVgVwVpreHTCUFEEOFw2vTk1DHbH6hHnLtryORqJyuiRg6knDbOG++9YzTvBaS IgHZ9AKh0b+YdiuAic9j0OOnX32+FrY= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH] x86/sgx: Use goto to remove redundant if check in sgx_encl_init X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum In-Reply-To: Date: Wed, 10 Dec 2025 16:48:08 +0100 Cc: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <9651D503-F2D9-4FE0-9593-8D204360C258@linux.dev> References: <20251210130035.545132-1-thorsten.blum@linux.dev> To: Jarkko Sakkinen X-Migadu-Flow: FLOW_OUT 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 >> --- >> [...] > > 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