Skip to contentSkip to conversation

x86/emul: Misc non-functional improvements

PATCH In review Andrew Cooper 2 participants 2 messages Feb 2, 2018 – Feb 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/emul: Misc non-functional improvements

* Drop trailing whitespace
* Use ARRAY_SIZE() rather than opencoding it

---
CC: Jan Beulich <[email protected]>

---
 xen/arch/x86/x86_emulate/x86_emulate.c | 13 ++++++-------
 xen/arch/x86/x86_emulate/x86_emulate.h | 12 ++++++------
 2 files changed, 12 insertions(+), 13 deletions(-)
xen/arch/x86/x86_emulate/x86_emulate.c +6 -7
index cc333a0..90c3a70 100644
@@ -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/>.
  */
@@ -2636,8 +2636,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,
xen/arch/x86/x86_emulate/x86_emulate.h +6 -6
index ab5ef41..99a6189 100644
@@ -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
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 02.02.18 at 17:54, <[email protected]> wrote:

* Drop trailing whitespace
* Use ARRAY_SIZE() rather than opencoding it

Apparently a left-over from when the test harness didn't have a suitable #define yet.

Quoted 1 line

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel