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

[Xen-changelog] [xen master] x86emul: fold local variables



commit fea586d801f75317cb8cf593e8beba842391da62
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jul 5 11:17:53 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jul 5 11:17:53 2016 +0200

    x86emul: fold local variables
    
    Declare some variables to they can be used by multiple pieces of code,
    allowing some figure braces to be dropped (which don't align nicely
    when used inside of case labeled statements).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 36 +++++++++++++++-------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index 271901c..fe594ba 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3561,6 +3561,8 @@ x86_emulate(
     case 0xf6 ... 0xf7: /* Grp3 */
         switch ( modrm_reg & 7 )
         {
+            unsigned long u[2], v;
+
         case 0 ... 1: /* test */
             goto test;
         case 2: /* not */
@@ -3599,15 +3601,15 @@ x86_emulate(
                 _regs.edx = (uint32_t)(dst.val >> 32);
                 break;
 #endif
-            default: {
-                unsigned long m[2] = { src.val, dst.val };
-                if ( mul_dbl(m) )
+            default:
+                u[0] = src.val;
+                u[1] = dst.val;
+                if ( mul_dbl(u) )
                     _regs.eflags |= EFLG_OF|EFLG_CF;
-                _regs.edx = m[1];
-                dst.val  = m[0];
+                _regs.edx = u[1];
+                dst.val  = u[0];
                 break;
             }
-            }
             break;
         case 5: /* imul */
             dst.type = OP_REG;
@@ -3643,20 +3645,18 @@ x86_emulate(
                     _regs.edx = (uint32_t)(dst.val >> 32);
                 break;
 #endif
-            default: {
-                unsigned long m[2] = { src.val, dst.val };
-                if ( imul_dbl(m) )
+            default:
+                u[0] = src.val;
+                u[1] = dst.val;
+                if ( imul_dbl(u) )
                     _regs.eflags |= EFLG_OF|EFLG_CF;
                 if ( b > 0x6b )
-                    _regs.edx = m[1];
-                dst.val  = m[0];
+                    _regs.edx = u[1];
+                dst.val  = u[0];
                 break;
             }
-            }
             break;
-        case 6: /* div */ {
-            unsigned long u[2], v;
-
+        case 6: /* div */
             dst.type = OP_REG;
             dst.reg  = (unsigned long *)&_regs.eax;
             switch ( dst.bytes = src.bytes )
@@ -3703,10 +3703,7 @@ x86_emulate(
                 break;
             }
             break;
-        }
-        case 7: /* idiv */ {
-            unsigned long u[2], v;
-
+        case 7: /* idiv */
             dst.type = OP_REG;
             dst.reg  = (unsigned long *)&_regs.eax;
             switch ( dst.bytes = src.bytes )
@@ -3754,7 +3751,6 @@ x86_emulate(
             }
             break;
         }
-        }
         break;
 
     case 0xf8: /* clc */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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