From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 083BC81E6E for ; Tue, 15 Nov 2016 08:59:26 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B0B73D48D; Tue, 15 Nov 2016 16:59:30 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-97.phx2.redhat.com [10.3.116.97]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAFGxSBg001460; Tue, 15 Nov 2016 11:59:29 -0500 To: Jeff Fan , edk2-devel@ml01.01.org References: <20161115083213.7700-1-jeff.fan@intel.com> Cc: Michael D Kinney , Feng Tian From: Laszlo Ersek Message-ID: Date: Tue, 15 Nov 2016 17:59:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161115083213.7700-1-jeff.fan@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 15 Nov 2016 16:59:30 +0000 (UTC) Subject: Re: [PATCH] UefiCpuPkg/SecCore: Use %x to print stack information X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 16:59:26 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 11/15/16 09:32, Jeff Fan wrote: > SecCoreData->StackBase is VOID * type and SecCoreData->StackSize is UINTN type. > We should use %x to dump their value instead of %lx. > > Cast pointer type to UINTN before print it. > > Cc: Feng Tian > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jeff Fan > --- > UefiCpuPkg/SecCore/SecMain.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c > index 2ebbc22..4d08f48 100644 > --- a/UefiCpuPkg/SecCore/SecMain.c > +++ b/UefiCpuPkg/SecCore/SecMain.c > @@ -239,9 +239,9 @@ SecStartupPhase2( > > DEBUG (( > DEBUG_INFO, > - "%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n", > + "%a() Stack Base: 0x%x, Stack Size: 0x%x\n", > __FUNCTION__, > - SecCoreData->StackBase, > + (UINTN) SecCoreData->StackBase, > SecCoreData->StackSize > )); > > Not disagreeing, just mentioning for completeness: we can also use %p for printing (VOID*) directly. Thanks Laszlo