[for_v31,4/6] x86/sgx: Replace "grab" with "alloc" in VA page helper
diff mbox series

Message ID 20200529175407.2109-5-sean.j.christopherson@intel.com
State New
Headers show
Series
  • x86/sgx: Misc fixes for v31
Related show

Commit Message

Sean Christopherson May 29, 2020, 5:54 p.m. UTC
Rename sgx_grab_va_page() to sgx_alloc_va_page() to align with
sgx_alloc_epc_page() as well as sgx_free_epc_page(); the latter is used
directly when freeing the VA page, i.e. the names should be consistent.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/encl.c  | 6 +++---
 arch/x86/kernel/cpu/sgx/encl.h  | 2 +-
 arch/x86/kernel/cpu/sgx/ioctl.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jarkko Sakkinen June 1, 2020, 12:53 a.m. UTC | #1
On Fri, May 29, 2020 at 10:54:05AM -0700, Sean Christopherson wrote:
> Rename sgx_grab_va_page() to sgx_alloc_va_page() to align with
> sgx_alloc_epc_page() as well as sgx_free_epc_page(); the latter is used
> directly when freeing the VA page, i.e. the names should be consistent.
> 
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Thanks I applied this directly to the page reclaimer patch.

/Jarkko

Patch
diff mbox series

diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
index e9d72f05a1f12..df4ae76dd83f6 100644
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -686,15 +686,15 @@  struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 }
 
 /**
- * sgx_grab_va_page() - Grab a Version Array (VA) page
+ * sgx_alloc_va_page() - Allocate a Version Array (VA) page
  *
- * Grab a free EPC page instance and convert it to a Version Array (VA) page.
+ * Allocate a free EPC page and convert it to a Version Array (VA) page.
  *
  * Return:
  *   a VA page,
  *   -errno otherwise
  */
-struct sgx_epc_page *sgx_grab_va_page(void)
+struct sgx_epc_page *sgx_alloc_va_page(void)
 {
 	struct sgx_epc_page *epc_page;
 	int ret;
diff --git a/arch/x86/kernel/cpu/sgx/encl.h b/arch/x86/kernel/cpu/sgx/encl.h
index 625ad44a83215..f0f72e5912445 100644
--- a/arch/x86/kernel/cpu/sgx/encl.h
+++ b/arch/x86/kernel/cpu/sgx/encl.h
@@ -120,7 +120,7 @@  int sgx_encl_test_and_clear_young(struct mm_struct *mm,
 struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 					    unsigned long addr);
 
-struct sgx_epc_page *sgx_grab_va_page(void);
+struct sgx_epc_page *sgx_alloc_va_page(void);
 unsigned int sgx_alloc_va_slot(struct sgx_va_page *va_page);
 void sgx_free_va_slot(struct sgx_va_page *va_page, unsigned int offset);
 bool sgx_va_page_full(struct sgx_va_page *va_page);
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index f7232a5343262..4f70cb8144ffd 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -32,7 +32,7 @@  static struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl)
 		if (!va_page)
 			return ERR_PTR(-ENOMEM);
 
-		va_page->epc_page = sgx_grab_va_page();
+		va_page->epc_page = sgx_alloc_va_page();
 		if (IS_ERR(va_page->epc_page)) {
 			err = ERR_CAST(va_page->epc_page);
 			kfree(va_page);