]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/emul: Misc non-functional improvements
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Feb 2018 11:42:05 +0000 (11:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Feb 2018 18:17:22 +0000 (18:17 +0000)
 * Drop trailing whitespace
 * Use ARRAY_SIZE() rather than opencoding it

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h

index f22f821bc54a09cba71dee65fd256370640d8680..bc8fa1d1b1282cca54220482eaa5dcf895d7eb1b 100644 (file)
@@ -1,21 +1,21 @@
 /******************************************************************************
  * x86_emulate.c
- * 
+ *
  * Generic x86 (32-bit and 64-bit) instruction decoder and emulator.
- * 
+ *
  * Copyright (c) 2005-2007 Keir Fraser
  * Copyright (c) 2005-2007 XenSource Inc.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
@@ -2650,8 +2650,7 @@ x86_decode(
                         goto done;
                     }
                 }
-                else if ( ext < ext_8f08 +
-                                sizeof(xop_table) / sizeof(*xop_table) )
+                else if ( ext < ext_8f08 + ARRAY_SIZE(xop_table) )
                 {
                     b = insn_fetch_type(uint8_t);
                     opcode |= MASK_INSR(0x8f08 + ext - ext_8f08,
index ab5ef4198cccea38fc54e1e5ecff127e6def79ba..99a618952d06d5867c54a2c8529e83ac8611fd0e 100644 (file)
@@ -1,21 +1,21 @@
 /******************************************************************************
  * x86_emulate.h
- * 
+ *
  * Generic x86 (32-bit and 64-bit) instruction decoder and emulator.
- * 
+ *
  * Copyright (c) 2005-2007 Keir Fraser
  * Copyright (c) 2005-2007 XenSource Inc.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
@@ -180,7 +180,7 @@ struct x86_emulate_state;
 /*
  * These operations represent the instruction emulator's interface to memory,
  * I/O ports, privileged state... pretty much everything other than GPRs.
- * 
+ *
  * NOTES:
  *  1. If the access fails (cannot emulate, or a standard access faults) then
  *     it is up to the memop to propagate the fault to the guest VM via