All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Chen <wei.chen@arm.com>
To: <wei.chen@arm.com>, <xen-devel@lists.xenproject.org>,
	<sstabellini@kernel.org>, <julien@xen.org>
Cc: <Bertrand.Marquis@arm.com>, <Penny.Zheng@arm.com>,
	<Jiamei.Xie@arm.com>, <nd@arm.com>
Subject: [PATCH v2 1/2] xen/arm: Correct the coding style of get_cycles
Date: Fri, 8 Jan 2021 14:21:25 +0800	[thread overview]
Message-ID: <20210108062126.2335873-1-wei.chen@arm.com> (raw)

It seems the arm inline function get_cycles has used 8 spaces for
line indent since 2012. This patch correct them to 4 spaces and
remove extra space between function name and bracket.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/asm-arm/time.h | 40 +++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index 1b2c13614b..5c4529ebb5 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -11,29 +11,29 @@
 
 typedef uint64_t cycles_t;
 
-static inline cycles_t get_cycles (void)
+static inline cycles_t get_cycles(void)
 {
-        isb();
+    isb();
+    /*
+     * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
+     * can return a wrong value when the counter crosses a 32bit boundary.
+     */
+    if ( !check_workaround_858921() )
+        return READ_SYSREG64(CNTPCT_EL0);
+    else
+    {
         /*
-         * ARM_WORKAROUND_858921: Cortex-A73 (all versions) counter read
-         * can return a wrong value when the counter crosses a 32bit boundary.
+         * A recommended workaround for erratum 858921 is to:
+         *  1- Read twice CNTPCT.
+         *  2- Compare bit[32] of the two read values.
+         *      - If bit[32] is different, keep the old value.
+         *      - If bit[32] is the same, keep the new value.
          */
-        if ( !check_workaround_858921() )
-            return READ_SYSREG64(CNTPCT_EL0);
-        else
-        {
-            /*
-             * A recommended workaround for erratum 858921 is to:
-             *  1- Read twice CNTPCT.
-             *  2- Compare bit[32] of the two read values.
-             *      - If bit[32] is different, keep the old value.
-             *      - If bit[32] is the same, keep the new value.
-             */
-            cycles_t old, new;
-            old = READ_SYSREG64(CNTPCT_EL0);
-            new = READ_SYSREG64(CNTPCT_EL0);
-            return (((old ^ new) >> 32) & 1) ? old : new;
-        }
+        cycles_t old, new;
+        old = READ_SYSREG64(CNTPCT_EL0);
+        new = READ_SYSREG64(CNTPCT_EL0);
+        return (((old ^ new) >> 32) & 1) ? old : new;
+    }
 }
 
 /* List of timer's IRQ */
-- 
2.25.1



             reply	other threads:[~2021-01-08  6:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  6:21 Wei Chen [this message]
2021-01-08  6:21 ` [PATCH v2 2/2] xen/arm: Add defensive barrier in get_cycles for Arm64 Wei Chen
2021-01-08 11:55   ` Julien Grall
2021-01-09 12:16     ` Wei Chen
2021-01-13 18:30       ` Julien Grall
2021-01-14  0:18         ` Wei Chen
2021-01-20 17:27           ` Julien Grall

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=20210108062126.2335873-1-wei.chen@arm.com \
    --to=wei.chen@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Jiamei.Xie@arm.com \
    --cc=Penny.Zheng@arm.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.