Skip to contentSkip to conversation

x86/PV: drop a local variable from pv_emulate_gate_op()

PATCH In review Jan Beulich 3 participants 3 messages Jun 2

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 x86/PV: drop a local variable from pv_emulate_gate_op()

The inner "rc" shadows the function scope one, thus violating Misra C:2012 rule 5.3 ("An identifier declared in an inner scope shall not hide an identifier declared in an outer scope"). Drop the inner variable, as there's no other (later) use of the value it holds.

No difference in generated code.

---
v3: Use alternative approach.
v2: Re-base.

xen/arch/x86/pv/emul-gate-op.c +0 -1
@@ -287,7 +287,6 @@ void pv_emulate_gate_op(struct cpu_user_
     {
         unsigned int ss, esp, *stkp;
         uint32_t value;
-        int rc;
 #define push(item) do \
         { \
             value = (item); \
Reviewed-by on v3 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

The inner "rc" shadows the function scope one, thus violating Misra C:2012 rule 5.3 ("An identifier declared in an inner scope shall not hide an identifier declared in an outer scope"). Drop the inner variable, as there's no other (later) use of the value it holds.

No difference in generated code.

#2 lore raw
In reply to Jan Beulich
Quoted 15 lines · Jan Beulich

The inner "rc" shadows the function scope one, thus violating Misra C:2012 rule 5.3 ("An identifier declared in an inner scope shall not hide an identifier declared in an outer scope"). Drop the inner variable, as there's no other (later) use of the value it holds.

No difference in generated code.

---
v3: Use alternative approach.
v2: Re-base.

xen/arch/x86/pv/emul-gate-op.c void pv_emulate_gate_op(struct cpu_user_ · line 292

Quoted 7 lines
xen/arch/x86/pv/emul-gate-op.c +0 -1
@@ -287,7 +287,6 @@ void pv_emulate_gate_op(struct cpu_user_
      {
          unsigned int ss, esp, *stkp;
          uint32_t value;
-        int rc;
  #define push(item) do \
          { \
              value = (item); \

Thanks.

~ Oleksii