[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] xen/arm: Correct the coding style of get_cycles


  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Tue, 5 Jan 2021 15:19:45 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9ZBzzxGzKpaz/jymkQKpqP+oHhtY7DR0dss6B4Pcejk=; b=VgZU3RD2R4XbTEOicKi7dRKXvNlDkFa7iSCmWWRoPWSlABhqBMbEC/lrUUYKbc0ZHzfnj5j7Z+a7A3OZOhucg6KW6pQ2LKVZ0hyr8jPvNQQ3tzY0gpJaWCf69w1KVlhY22He6FRS9f3m8Ir7rfOE/HB4H0KydIejVaMfuO2uyrNR9DFx49l0LlZxAm4y2tuuBAWZ0lHV0Yhm8/APG52pJoOeiXQJ/mVd2WXH5f2TAai40CXbjGZwMNfwrzmMkWO/3ISshnHeFNbB6sc7B9CeLEtaoYJa9VmnVaSfQdvi3ouKRHHTfOTqlJ6QC9vNgKBIfqxejBXi/QDBhH6iw4nBkw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDEI9MbGRSYo1NZkw4gCX64rSJDgMCkxv0WZrky+CrLH7tP2ujrPHgnXkdyi4utoEIQHI2CLC1BmGwLCkjQsGvzhaqDV18TZsJgMTF0cfO21cPauWWMebm2zZOfNokP+zNss+q3fhi/EbiiWxEH33lKoVjUhIRlMUtLAbfXwY1m/yDmmmUUjPnkSSiUHWrwscfiys+dGmYIiNe/h+Jyv/JsVZ/pjLSLJ/aGsWPrDbEr3FN9cN9OFnTUvgQI3VY51IYLAS8a6NoIzkn3QQGDL6nkkMzNa9JVjXKOZWMzb5GduC4Wfb/VSMGJ61v9XXbctU9wvBZc5U40QudIHcbTPqw==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <Penny.Zheng@xxxxxxx>, <Jiamei.Xie@xxxxxxx>, <nd@xxxxxxx>
  • Delivery-date: Tue, 05 Jan 2021 07:20:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

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@xxxxxxx>
---
 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.