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.web10.1727.1588791455749006435 for ; Wed, 06 May 2020 11:57:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sz+za0x0; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588791454; 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=SiADLLZKrnTWAfyjARxQ/xHblAHdjo1mfJSKqwJEf2g=; b=Sz+za0x0tfChH9mg0RS2pCFulUmxTtDMnFb+cJhl6r8uTt5667Y1oO0iN79ABGFj5mP2TZ YD/HdRNYfUHgtspQoKVKgJTsceRulOlTQNvhAu+R4yAV6Iaf87kYopfOY5fhtAvxSZd471 RZgWlUedy0rfiV9UzS8Nr+hAxfiQL+Q= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-71-VcFjg3dQPLiUpyNlzEJAig-1; Wed, 06 May 2020 14:57:32 -0400 X-MC-Unique: VcFjg3dQPLiUpyNlzEJAig-1 Received: by mail-wm1-f69.google.com with SMTP id n17so1212349wmi.3 for ; Wed, 06 May 2020 11:57:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SiADLLZKrnTWAfyjARxQ/xHblAHdjo1mfJSKqwJEf2g=; b=fB6/BhR8HY3WEc9hv4VLtPeKb6UbO6YcJylts6o4y1FhdtAnlqIW/15ec5jCEDr9ZL mx1t/id3quqT6j6QsxMXhJSWdvqzTiLoy0g70m7DbqQnYoyW+EGDhEZlPfMP+yruPszi YzS+dWci+hPUVK1qKj6PIwyDSsjtYV7MrEPrqOoDCW2vlAhGxXfb46pbHQnD9Py1cPGL fkWaaNhTe3B9EjcI2iOkjcO+SNa3BoukL5eNeq0RQA567rHdNnQL/sp/cCpDaVhDge7D sWsXHbiaRKF0WuS9+vUaf6vt87iu4EGMk5d3UXlUQ2feVR6VLXpImMHugDC89lCpI29o dB7g== X-Gm-Message-State: AGi0PubHocC+qjDtuXI3ey/GoA7+sxdn4L1CvXAvXsiF7eMe5C4OhU+9 FDk4NDURvMv9bwst/gsKFxlpr7vwgIR9BDSoOEoWr6a1zrirCXAVj18/bM5ft0Yut5Cv/Kqw+Co BvVGPIvA2JFqg5w== X-Received: by 2002:a7b:c38b:: with SMTP id s11mr6048275wmj.55.1588791451046; Wed, 06 May 2020 11:57:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJsyGfwwsZlSxxSPgEXn+K952yhgzYkkRKMkAUxy+A/0shgMefIW69sfa80Gc045Am0uo3iuQ== X-Received: by 2002:a7b:c38b:: with SMTP id s11mr6048260wmj.55.1588791450831; Wed, 06 May 2020 11:57:30 -0700 (PDT) Return-Path: Received: from [192.168.1.39] (248.red-88-21-203.staticip.rima-tde.net. [88.21.203.248]) by smtp.gmail.com with ESMTPSA id d133sm4777971wmc.27.2020.05.06.11.57.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2020 11:57:30 -0700 (PDT) Subject: Re: [PATCH v2 1/1] ShellPkg: smbiosview - print field values as unsigned integers To: Rebecca Cran , devel@edk2.groups.io Cc: Ray Ni , Zhichao Gao References: <20200506165205.17360-1-rebecca@bsdio.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: Date: Wed, 6 May 2020 20:57:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200506165205.17360-1-rebecca@bsdio.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 5/6/20 6:52 PM, Rebecca Cran wrote: > This prevents overflow when printing DWORD fields such as the type 17 > tables's extended DIMM size. > > Signed-off-by: Rebecca Cran > Cc: Ray Ni > Cc: Zhichao Gao > Cc: Philippe Mathieu-Daude > --- > .../UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c > index a75caff3de34..1ea7b84bd0fa 100644 > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c > @@ -49,7 +49,7 @@ > #define PRINT_STRUCT_VALUE(pStruct, type, element) \ > do { \ > ShellPrintEx(-1,-1,L"%a",#element); \ > - ShellPrintEx(-1,-1,L": %d\n", (pStruct->type->element)); \ > + ShellPrintEx(-1,-1,L": %u\n", (pStruct->type->element)); \ > } while (0); > > #define PRINT_STRUCT_VALUE_H(pStruct, type, element) \ > @@ -634,8 +634,8 @@ SmbiosPrintStructure ( > NumOfItem = (Struct->Type14->Hdr.Length - 5) / 3; > PRINT_PENDING_STRING (Struct, Type14, GroupName); > for (Index = 0; Index < NumOfItem; Index++) { > - ShellPrintEx(-1,-1,L"ItemType %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemType); > - ShellPrintEx(-1,-1,L"ItemHandle %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemHandle); > + ShellPrintEx(-1,-1,L"ItemType %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemType); > + ShellPrintEx(-1,-1,L"ItemHandle %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemHandle); > } > } > break; > Reviewed-by: Philippe Mathieu-Daude