All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: [PATCH 3/3] x86/sgx: Fix whitespace damage in sgx_encl_page_alloc()
Date: Fri, 23 Aug 2019 14:52:36 -0700	[thread overview]
Message-ID: <20190823215236.8081-4-sean.j.christopherson@intel.com> (raw)
In-Reply-To: <20190823215236.8081-1-sean.j.christopherson@intel.com>

Fix a variety of recently introduced whitespace damage.  No functional
change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/ioctl.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index ead9fb2d9b69..3ce7849f067b 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -133,7 +133,7 @@ static struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl,
 						 u64 secinfo_flags)
 {
 	struct sgx_encl_page *encl_page;
-       unsigned long prot;
+	unsigned long prot;
 
 	encl_page = kzalloc(sizeof(*encl_page), GFP_KERNEL);
 	if (!encl_page)
@@ -145,18 +145,17 @@ static struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl,
 	if (secinfo_flags & SGX_SECINFO_TCS)
 		encl_page->desc |= SGX_ENCL_PAGE_TCS;
 
+	prot = _calc_vm_trans(secinfo_flags, SGX_SECINFO_R, PROT_READ)  |
+	       _calc_vm_trans(secinfo_flags, SGX_SECINFO_W, PROT_WRITE) |
+	       _calc_vm_trans(secinfo_flags, SGX_SECINFO_X, PROT_EXEC);
 
-       prot = _calc_vm_trans(secinfo_flags, SGX_SECINFO_R, PROT_READ)  |
-	      _calc_vm_trans(secinfo_flags, SGX_SECINFO_W, PROT_WRITE) |
-	      _calc_vm_trans(secinfo_flags, SGX_SECINFO_X, PROT_EXEC);
-
-       /*
-	* TCS pages must always RW set for CPU access while the SECINFO
-	* permissions are *always* zero - the CPU ignores the user provided
-	* values and silently overwrites them with zero permissions.
-	*/
-       if ((secinfo_flags & SGX_SECINFO_PAGE_TYPE_MASK) == SGX_SECINFO_TCS)
-	       prot |= PROT_READ | PROT_WRITE;
+	/*
+	 * TCS pages must always RW set for CPU access while the SECINFO
+	 * permissions are *always* zero - the CPU ignores the user provided
+	 * values and silently overwrites them with zero permissions.
+	 */
+	if ((secinfo_flags & SGX_SECINFO_PAGE_TYPE_MASK) == SGX_SECINFO_TCS)
+		prot |= PROT_READ | PROT_WRITE;
 
 	/* Calculate maximum of the VM flags for the page. */
 	encl_page->vm_max_prot_bits = calc_vm_prot_bits(prot, 0);
-- 
2.22.0


  parent reply	other threads:[~2019-08-23 21:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson
2019-08-23 21:52 ` [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch Sean Christopherson
2019-08-23 21:52 ` [PATCH 2/3] x86/sgx: Add missing SPDX license to encls.c Sean Christopherson
2019-08-23 21:52 ` Sean Christopherson [this message]
2019-08-26  5:38 ` [PATCH 0/3] x86/sgx: Misc code cleanups Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190823215236.8081-4-sean.j.christopherson@intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.