Skip to content

Commit

Permalink
x86/kvm: Resolve shadow warnings in macro expansion
Browse files Browse the repository at this point in the history
Resolve shadow warnings that appear in W=2 builds. Instead of
using ret to hold the return pointer, save the length in a new
variable saved_len and compute the pointer on exit. This also
resolves a very technical error, in that ret was declared as
a const char *, when it really was a char * const.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Mark D Rustad authored and Paolo Bonzini committed Jul 31, 2014
1 parent 307d274 commit 42cbc04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/mmutrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__entry->unsync = sp->unsync;

#define KVM_MMU_PAGE_PRINTK() ({ \
const char *ret = p->buffer + p->len; \
const u32 saved_len = p->len; \
static const char *access_str[] = { \
"---", "--x", "w--", "w-x", "-u-", "-ux", "wu-", "wux" \
}; \
Expand All @@ -41,7 +41,7 @@
role.nxe ? "" : "!", \
__entry->root_count, \
__entry->unsync ? "unsync" : "sync", 0); \
ret; \
p->buffer + saved_len; \
})

#define kvm_mmu_trace_pferr_flags \
Expand Down

0 comments on commit 42cbc04

Please sign in to comment.