From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1C08C00144 for ; Mon, 1 Aug 2022 16:41:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbiHAQll (ORCPT ); Mon, 1 Aug 2022 12:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbiHAQlj (ORCPT ); Mon, 1 Aug 2022 12:41:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE3116427; Mon, 1 Aug 2022 09:41:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7C7E960F9D; Mon, 1 Aug 2022 16:41:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 554D7C433C1; Mon, 1 Aug 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659372097; bh=vxWBXnawqlQkezkT2MfuFpk6srPiBr+yMl0+CH6pltw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fkz3mwZZd9slSj+Tz/CK4pGdXsqcmGiv9+h7ZvruEdACsS59uLdmyG2cRzS2a3tvb J+WycMhpNEPP/PsPFwpXIKf2rqmDMIckTxEFDaNzCQbwsrBGknhrqyPq4EjvtZ00jQ I5/vPDTGG5tZ923nmP6DeCj4C7wcLmgv4/KdvzVAu0hhYTBsJN5NDbW3dzqSUdWkMJ rqEKa0CWQpMzVwyIOdE+S8faqQUylZ8oYpv7wf7v4YqYnyZ/JwL/6Wl2Fkh2Yn8vHH Ur6psHY1vCpSFDyzca04tNzAv7OJvpxy39GOAIvO71yhqqk+h/0vCqUR1wmhADN4c+ 5lzEz9ksRiWxA== Date: Mon, 1 Aug 2022 19:41:32 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Kristen Carlson Accardi , linux-kernel@vger.kernel.org, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-sgx@vger.kernel.org Subject: Re: [PATCH] x86/sgx: Improve comments for sgx_encl_lookup/alloc_backing() Message-ID: References: <20220720182120.1160956-1-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Mon, Aug 01, 2022 at 07:40:42PM +0300, Jarkko Sakkinen wrote: > On Thu, Jul 28, 2022 at 06:47:01AM -0700, Dave Hansen wrote: > > On 7/28/22 00:58, Jarkko Sakkinen wrote: > > > On Wed, Jul 20, 2022 at 11:21:19AM -0700, Kristen Carlson Accardi wrote: > > >> Modify the comments for sgx_encl_lookup_backing() and for > > >> sgx_encl_alloc_backing() to indicate that they take a reference > > >> which must be dropped with a call to sgx_encl_put_backing(). > > >> Make sgx_encl_lookup_backing() static for now, and change the > > >> name of sgx_encl_get_backing() to __sgx_encl_get_backing() to > > >> make it more clear that sgx_encl_get_backing() is an internal > > >> function. > > >> > > >> Signed-off-by: Kristen Carlson Accardi > > > The rename is unnecessary. > > > > Well, it was done to address some reviewer confusion: > > > > https://lore.kernel.org/all/YtUs3MKLzFg+rqEV@zn.tnic/ > > > > I wouldn't call it unnecessary. Heck, I'd argue that the one of the > > main reasons that this code leaked memory in the first place was the > > naming and lack of comments. > > Maybe the rename should be its own patch with this tag in the commit: > > Link: https://lore.kernel.org/all/YtUs3MKLzFg+rqEV@zn.tnic/ Actually, just adding this to the current patch would be fine (no need to split necessariy). BR, Jarkko