Skip to contentSkip to conversation

x86: Fix warnings in kvm_emulate.h

PATCH New [email protected] 1 participant 1 message Jul 13, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 x86: Fix warnings in kvm_emulate.h

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'

---
 arch/x86/kvm/kvm_emulate.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/kvm/kvm_emulate.h +8 -8
index ab65f3a47dfd..652020025457 100644
@@ -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);
     /*
      * 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);