Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42cbc04f authored by Mark D Rustad's avatar Mark D Rustad Committed by Paolo Bonzini
Browse files

x86/kvm: Resolve shadow warnings in macro expansion



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: default avatarMark Rustad <mark.d.rustad@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 307d2740
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
	__entry->unsync = sp->unsync;
	__entry->unsync = sp->unsync;


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


#define kvm_mmu_trace_pferr_flags       \
#define kvm_mmu_trace_pferr_flags       \