From patchwork Wed Jul 30 21:19:26 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: 4651701 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 F0F27C0338 for ; Wed, 30 Jul 2014 21:19:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13DF02018E for ; Wed, 30 Jul 2014 21:19:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CAEF2017A for ; Wed, 30 Jul 2014 21:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbaG3VT2 (ORCPT ); Wed, 30 Jul 2014 17:19:28 -0400 Received: from mga14.intel.com ([192.55.52.115]:53239 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbaG3VT1 (ORCPT ); Wed, 30 Jul 2014 17:19:27 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Jul 2014 14:12:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,767,1400050800"; d="scan'208";a="569649200" Received: from mdrustad-wks.jf.intel.com ([134.134.176.106]) by fmsmga001.fm.intel.com with ESMTP; 30 Jul 2014 14:19:26 -0700 Subject: [PATCH V2 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: Wed, 30 Jul 2014 14:19:26 -0700 Message-ID: <20140730211926.127150.102.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 \