[intel-sgx-kernel-dev,4/4] intel_sgx: rename EWB related functions
diff mbox

Message ID 1492009821-22428-5-git-send-email-sean.j.christopherson@intel.com
State New
Headers show

Commit Message

Sean Christopherson April 12, 2017, 3:10 p.m. UTC
Rename sgx_ewb->sgx_evict_page and __sgx_ewb->sgx_ewb, and remove
the previous sgx_evict_page, which was literally a pass-through to
the previous sgx_ewb.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 drivers/platform/x86/intel_sgx/sgx_page_cache.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Jarkko Sakkinen April 13, 2017, 1:10 p.m. UTC | #1
On Wed, Apr 12, 2017 at 08:10:21AM -0700, Sean Christopherson wrote:
> Rename sgx_ewb->sgx_evict_page and __sgx_ewb->sgx_ewb, and remove
> the previous sgx_evict_page, which was literally a pass-through to
> the previous sgx_ewb.
> 
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

NAK for the renames. ACK for dropping the redundant function.

/Jarkko

> ---
>  drivers/platform/x86/intel_sgx/sgx_page_cache.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel_sgx/sgx_page_cache.c b/drivers/platform/x86/intel_sgx/sgx_page_cache.c
> index 346b82c..4c2038f 100644
> --- a/drivers/platform/x86/intel_sgx/sgx_page_cache.c
> +++ b/drivers/platform/x86/intel_sgx/sgx_page_cache.c
> @@ -289,8 +289,8 @@ static inline unsigned int sgx_alloc_va_slot(struct sgx_encl *encl,
>         return slot << 3;
>  }
>  
> -static int __sgx_ewb(struct sgx_encl *encl,
> -		     struct sgx_encl_page *encl_page)
> +static int sgx_ewb(struct sgx_encl *encl,
> +		   struct sgx_encl_page *encl_page)
>  {
>  	struct sgx_page_info pginfo;
>  	struct sgx_va_page *va_page;
> @@ -357,15 +357,15 @@ static int __sgx_ewb(struct sgx_encl *encl,
>  	return ret;
>  }
>  
> -static bool sgx_ewb(struct sgx_encl *encl,
> -		    struct sgx_encl_page *entry)
> +static bool sgx_evict_page(struct sgx_encl_page *entry,
> +			   struct sgx_encl *encl)
>  {
> -	int ret = __sgx_ewb(encl, entry);
> +	int ret = sgx_ewb(encl, entry);
>  
>  	if (ret == SGX_NOT_TRACKED) {
>  		/* slow path, IPI needed */
>  		sgx_flush_cpus(encl);
> -		ret = __sgx_ewb(encl, entry);
> +		ret = sgx_ewb(encl, entry);
>  	}
>  
>  	if (ret) {
> @@ -380,12 +380,6 @@ static bool sgx_ewb(struct sgx_encl *encl,
>  	return true;
>  }
>  
> -static void sgx_evict_page(struct sgx_encl_page *entry,
> -			   struct sgx_encl *encl)
> -{
> -	sgx_ewb(encl, entry);
> -}
> -
>  static void sgx_write_pages(struct sgx_encl *encl, struct list_head *src)
>  {
>  	struct sgx_encl_page *entry;
> -- 
> 2.7.4
> 
> _______________________________________________
> intel-sgx-kernel-dev mailing list
> intel-sgx-kernel-dev@lists.01.org
> https://lists.01.org/mailman/listinfo/intel-sgx-kernel-dev

Patch
diff mbox

diff --git a/drivers/platform/x86/intel_sgx/sgx_page_cache.c b/drivers/platform/x86/intel_sgx/sgx_page_cache.c
index 346b82c..4c2038f 100644
--- a/drivers/platform/x86/intel_sgx/sgx_page_cache.c
+++ b/drivers/platform/x86/intel_sgx/sgx_page_cache.c
@@ -289,8 +289,8 @@  static inline unsigned int sgx_alloc_va_slot(struct sgx_encl *encl,
        return slot << 3;
 }
 
-static int __sgx_ewb(struct sgx_encl *encl,
-		     struct sgx_encl_page *encl_page)
+static int sgx_ewb(struct sgx_encl *encl,
+		   struct sgx_encl_page *encl_page)
 {
 	struct sgx_page_info pginfo;
 	struct sgx_va_page *va_page;
@@ -357,15 +357,15 @@  static int __sgx_ewb(struct sgx_encl *encl,
 	return ret;
 }
 
-static bool sgx_ewb(struct sgx_encl *encl,
-		    struct sgx_encl_page *entry)
+static bool sgx_evict_page(struct sgx_encl_page *entry,
+			   struct sgx_encl *encl)
 {
-	int ret = __sgx_ewb(encl, entry);
+	int ret = sgx_ewb(encl, entry);
 
 	if (ret == SGX_NOT_TRACKED) {
 		/* slow path, IPI needed */
 		sgx_flush_cpus(encl);
-		ret = __sgx_ewb(encl, entry);
+		ret = sgx_ewb(encl, entry);
 	}
 
 	if (ret) {
@@ -380,12 +380,6 @@  static bool sgx_ewb(struct sgx_encl *encl,
 	return true;
 }
 
-static void sgx_evict_page(struct sgx_encl_page *entry,
-			   struct sgx_encl *encl)
-{
-	sgx_ewb(encl, entry);
-}
-
 static void sgx_write_pages(struct sgx_encl *encl, struct list_head *src)
 {
 	struct sgx_encl_page *entry;