From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.2764.1580719611604765261 for ; Mon, 03 Feb 2020 00:46:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PURqH2Md; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580719609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v6Vy4d42L1k1DwmZroyVXJS8+CC+M7cB+xwMoNR97NU=; b=PURqH2MdDZveK5hKIu+WY0C8TOKuQhhn28/IZTyLt8zSmONM8m6V/FD8cuzRN9zQ+/hEcx nCFw8v38hEU9q/ZAKdDO1Ye7iLGezL99sr4kQ+3tCLe4dh2TqLp3o9kOzIXW5TfvdV4MY/ SUNeJupQXqcRQ5sOSPEYMnduMjTl7gU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-jzhm5BU7M0mcigSxLzca8g-1; Mon, 03 Feb 2020 03:46:43 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59906107B29A; Mon, 3 Feb 2020 08:46:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-136.ams2.redhat.com [10.36.116.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44CCB91820; Mon, 3 Feb 2020 08:46:41 +0000 (UTC) Subject: Re: [PATCH] UefiCpuPkg RegisterCpuFeaturesLib: Use %08x to print CacheControl Index To: Star Zeng , devel@edk2.groups.io Cc: Eric Dong , Ray Ni References: <20200203070631.14332-1-star.zeng@intel.com> From: "Laszlo Ersek" Message-ID: <3bf7a886-205b-957b-6573-9fa6f04c169e@redhat.com> Date: Mon, 3 Feb 2020 09:46:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200203070631.14332-1-star.zeng@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: jzhm5BU7M0mcigSxLzca8g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Hello Star, On 02/03/20 08:06, Star Zeng wrote: > Instead of %08lx, use %08x to print CacheControl Index > as it is UINT32 type. > > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Star Zeng > --- > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > index 0a4fcff033a3..1a02809b0e7c 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > @@ -465,7 +465,7 @@ DumpRegisterTableOnProcessor ( > case CacheControl: > DEBUG (( > DebugPrintErrorLevel, > - "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n", > + "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n", > ProcessorNumber, > FeatureIndex, > RegisterTableEntry->Index, > if you are already touching this DEBUG invocation, can you please fix the rest of the issues with the format string? - ProcessorNumber is UINTN. If we know for sure it can be represented in a UINT32, then it should be cast to UINT32 explicitly, and logged with "%04u". (Otherwise, UINTN needs to be cast to UINT64, and logged with %lu or %lx.) - Ditto for FeatureIndex. The rest of the format specifications (including the now-fixed CPU_REGISTER_TABLE_ENTRY.Index) are OK. Thanks Laszlo