From patchwork Thu Jul 31 16:59:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rustad, Mark D" X-Patchwork-Id: 4657831 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0D97C0338 for ; Thu, 31 Jul 2014 16:59:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22C4920103 for ; Thu, 31 Jul 2014 16:59:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48FC0200E9 for ; Thu, 31 Jul 2014 16:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753232AbaGaQ7n (ORCPT ); Thu, 31 Jul 2014 12:59:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:19905 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230AbaGaQ7n (ORCPT ); Thu, 31 Jul 2014 12:59:43 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 31 Jul 2014 09:59:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,773,1400050800"; d="scan'208";a="581792044" Received: from mdrustad-wks.jf.intel.com ([134.134.176.106]) by orsmga002.jf.intel.com with ESMTP; 31 Jul 2014 09:59:42 -0700 Subject: [PATCH V3 3/4] x86/kvm: Resolve shadow warnings in macro expansion From: Mark D Rustad To: gleb@kernel.org, pbonzini@redhat.com Cc: mark.d.rustad@intel.com, jeffrey.t.kirsher@intel.com, kvm@vger.kernel.org Date: Thu, 31 Jul 2014 09:59:42 -0700 Message-ID: <20140731165942.53703.61587.stgit@mdrustad-wks.jf.intel.com> In-Reply-To: <1406294825-21393-3-git-send-email-jeffrey.t.kirsher@intel.com> References: <1406294825-21393-3-git-send-email-jeffrey.t.kirsher@intel.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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, which theoretically could have allowed the compiler to do something wrong. Signed-off-by: Mark Rustad Signed-off-by: Jeff Kirsher --- Changes in V2: - Instead of renaming all inner variables, just delete the ret variable in favor of the new saved_len variable. --- arch/x86/kvm/mmutrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/mmutrace.h b/arch/x86/kvm/mmutrace.h index 9d2e0ffcb190..5aaf35641768 100644 --- a/arch/x86/kvm/mmutrace.h +++ b/arch/x86/kvm/mmutrace.h @@ -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" \ }; \ @@ -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 \