diff mbox series

x86: Fix warnings in kvm_emulate.h

Message ID a96564ba2d5b643fdbca000f686f2843@208suo.com (mailing list archive)
State New, archived
Headers show
Series x86: Fix warnings in kvm_emulate.h | expand

Commit Message

huzhi001@208suo.com July 13, 2023, 12:48 p.m. UTC
The following checkpatch warnings are removed:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: ZhiHu <huzhi001@208suo.com>
---
  arch/x86/kvm/kvm_emulate.h | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)

       * read_std: Read bytes of standard (non-emulated/special) memory.
       *           Used for descriptor reading.
@@ -240,10 +240,10 @@ struct operand {
          unsigned long *reg;
          struct segmented_address {
              ulong ea;
-            unsigned seg;
+            unsigned int seg;
          } mem;
-        unsigned xmm;
-        unsigned mm;
+        unsigned int xmm;
+        unsigned int mm;
      } addr;
      union {
          unsigned long val;
@@ -508,7 +508,7 @@ void emulator_invalidate_register_cache(struct 
x86_emulate_ctxt *ctxt);
  void emulator_writeback_register_cache(struct x86_emulate_ctxt *ctxt);
  bool emulator_can_use_gpa(struct x86_emulate_ctxt *ctxt);

-static inline ulong reg_read(struct x86_emulate_ctxt *ctxt, unsigned 
nr)
+static inline ulong reg_read(struct x86_emulate_ctxt *ctxt, unsigned 
int nr)
  {
      if (KVM_EMULATOR_BUG_ON(nr >= NR_EMULATOR_GPRS, ctxt))
          nr &= NR_EMULATOR_GPRS - 1;
@@ -520,7 +520,7 @@ static inline ulong reg_read(struct x86_emulate_ctxt 
*ctxt, unsigned nr)
      return ctxt->_regs[nr];
  }

-static inline ulong *reg_write(struct x86_emulate_ctxt *ctxt, unsigned 
nr)
+static inline ulong *reg_write(struct x86_emulate_ctxt *ctxt, unsigned 
int nr)
  {
      if (KVM_EMULATOR_BUG_ON(nr >= NR_EMULATOR_GPRS, ctxt))
          nr &= NR_EMULATOR_GPRS - 1;
@@ -533,7 +533,7 @@ static inline ulong *reg_write(struct 
x86_emulate_ctxt *ctxt, unsigned nr)
      return &ctxt->_regs[nr];
  }

-static inline ulong *reg_rmw(struct x86_emulate_ctxt *ctxt, unsigned 
nr)
+static inline ulong *reg_rmw(struct x86_emulate_ctxt *ctxt, unsigned 
int nr)
  {
      reg_read(ctxt, nr);
      return reg_write(ctxt, nr);
diff mbox series

Patch

diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
index ab65f3a47dfd..652020025457 100644
--- a/arch/x86/kvm/kvm_emulate.h
+++ b/arch/x86/kvm/kvm_emulate.h
@@ -95,14 +95,14 @@  struct x86_emulate_ops {
       *
       * @reg: gpr number.
       */
-    ulong (*read_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg);
+    ulong (*read_gpr)(struct x86_emulate_ctxt *ctxt, unsigned int reg);
      /*
       * write_gpr: write a general purpose register (rax - r15)
       *
       * @reg: gpr number.
       * @val: value to write.
       */
-    void (*write_gpr)(struct x86_emulate_ctxt *ctxt, unsigned reg, 
ulong val);
+    void (*write_gpr)(struct x86_emulate_ctxt *ctxt, unsigned int reg, 
ulong val);
      /*