From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0CB7FD806DD for ; Sun, 24 Dec 2023 22:59:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JKsq3r4J2KkQAMmbh6jhwbbvLXkw8DdN/dO93LkWB5U=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1703458783; v=1; b=WMo1YWcR2vmX6oeWUKTzawmRYS6GnWFgDNDUmmGkGpBMFfLTck9akKQQ6iwUVRyWHrZUrn4a 9QpQrZzaMFcJRfkICzW+ahfOroId9ebYudSyIAHrj3eSlEFnwN3kIYxXT6uXvOq4BTiPflxydD6 LRXFw3+veE4DJWCVez9ViADI= X-Received: by 127.0.0.2 with SMTP id IYgPYY7687511xlZ1CWjsxiz; Sun, 24 Dec 2023 14:59:43 -0800 X-Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web10.35948.1703458782013216182 for ; Sun, 24 Dec 2023 14:59:42 -0800 X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50e4e3323a6so4311284e87.0 for ; Sun, 24 Dec 2023 14:59:41 -0800 (PST) X-Gm-Message-State: l65uj1mrhJYEVA9D747uulJ2x7686176AA= X-Google-Smtp-Source: AGHT+IFpZjIhHPV116gmAY5+tXlKTkV1jgIvLV5aKKA6iANqMhBfdXlzQGynV1q4oDeiQ9AdGHl+6g== X-Received: by 2002:a19:4348:0:b0:50e:3879:8222 with SMTP id m8-20020a194348000000b0050e38798222mr2398758lfj.21.1703458780166; Sun, 24 Dec 2023 14:59:40 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id be44-20020a056512252c00b0050e78f5178asm326596lfb.262.2023.12.24.14.59.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 24 Dec 2023 14:59:39 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin , Pedro Falcato Subject: [edk2-devel] [PATCH v3 11/16] RedfishDiscoverDxe: refine InitInformationData(), remove unnecessary casts Date: Mon, 25 Dec 2023 01:59:22 +0300 Message-Id: <20231224225927.9119-12-mike.maslenkin@gmail.com> In-Reply-To: <20231224225927.9119-1-mike.maslenkin@gmail.com> References: <20231224225927.9119-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=WMo1YWcR; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Pedro Falcato Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../RedfishDiscoverDxe/RedfishDiscoverDxe.c | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPk= g/RedfishDiscoverDxe/RedfishDiscoverDxe.c index 7aa68b54a61b..0ac41f09559b 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -730,12 +730,12 @@ VOID InitInformationData (=0D IN EFI_REDFISH_DISCOVERED_INFORMATION *Information,=0D IN UINTN *RedfishVersion OPTIONAL,=0D - IN CHAR8 *RedfishLocation OPTIONAL,=0D - IN CHAR8 *Uuid OPTIONAL,=0D - IN CHAR8 *Os OPTIONAL,=0D - IN CHAR8 *OsVer OPTIONAL,=0D - IN CHAR8 *Product OPTIONAL,=0D - IN CHAR8 *ProductVer OPTIONAL=0D + IN CONST CHAR8 *RedfishLocation OPTIONAL,=0D + IN CONST CHAR8 *Uuid OPTIONAL,=0D + IN CONST CHAR8 *Os OPTIONAL,=0D + IN CONST CHAR8 *OsVer OPTIONAL,=0D + IN CONST CHAR8 *Product OPTIONAL,=0D + IN CONST CHAR8 *ProductVer OPTIONAL=0D )=0D {=0D if (RedfishVersion !=3D NULL) {=0D @@ -744,33 +744,33 @@ InitInformationData ( }=0D =0D if (RedfishLocation !=3D NULL) {=0D - Information->Location =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CONST= CHAR8 *)RedfishLocation) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)RedfishLocation, Information->Lo= cation, AsciiStrSize ((CONST CHAR8 *)RedfishLocation) * sizeof (CHAR16));=0D + Information->Location =3D AllocatePool (AsciiStrSize (RedfishLocation)= * sizeof (CHAR16));=0D + AsciiStrToUnicodeStrS (RedfishLocation, Information->Location, AsciiSt= rSize (RedfishLocation) * sizeof (CHAR16));=0D DEBUG ((DEBUG_MANAGEABILITY, "Redfish service location: %s.\n", Inform= ation->Location));=0D }=0D =0D if (Uuid !=3D NULL) {=0D - Information->Uuid =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CONST CHA= R8 *)Uuid) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)Uuid, Information->Uuid, AsciiSt= rSize ((CONST CHAR8 *)Uuid) * sizeof (CHAR16));=0D + Information->Uuid =3D AllocatePool (AsciiStrSize (Uuid) * sizeof (CHAR= 16));=0D + AsciiStrToUnicodeStrS (Uuid, Information->Uuid, AsciiStrSize (Uuid) * = sizeof (CHAR16));=0D DEBUG ((DEBUG_MANAGEABILITY, "Service UUID: %s.\n", Information->Uuid)= );=0D }=0D =0D if (Os !=3D NULL) {=0D - Information->Os =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CONST CHAR8= *)Os) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)Os, Information->Os, AsciiStrSiz= e ((CONST CHAR8 *)Os) * sizeof (CHAR16));=0D + Information->Os =3D AllocatePool (AsciiStrSize (Os) * sizeof (CHAR16))= ;=0D + AsciiStrToUnicodeStrS (Os, Information->Os, AsciiStrSize (Os) * sizeof= (CHAR16));=0D DEBUG ((DEBUG_MANAGEABILITY, "Redfish service OS: %s, Version:%s.\n", = Information->Os, Information->OsVersion));=0D }=0D =0D if (OsVer !=3D NULL) {=0D - Information->OsVersion =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CONS= T CHAR8 *)OsVer) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)OsVer, Information->OsVersion, A= sciiStrSize ((CONST CHAR8 *)OsVer) * sizeof (CHAR16));=0D + Information->OsVersion =3D AllocatePool (AsciiStrSize (OsVer) * sizeof= (CHAR16));=0D + AsciiStrToUnicodeStrS (OsVer, Information->OsVersion, AsciiStrSize (Os= Ver) * sizeof (CHAR16));=0D }=0D =0D if ((Product !=3D NULL) && (ProductVer !=3D NULL)) {=0D - Information->Product =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CONST = CHAR8 *)Product) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)Product, Information->Product, A= sciiStrSize ((CONST CHAR8 *)Product) * sizeof (CHAR16));=0D - Information->ProductVer =3D (CHAR16 *)AllocatePool (AsciiStrSize ((CON= ST CHAR8 *)ProductVer) * sizeof (CHAR16));=0D - AsciiStrToUnicodeStrS ((CONST CHAR8 *)ProductVer, Information->Product= Ver, AsciiStrSize ((CONST CHAR8 *)ProductVer) * sizeof (CHAR16));=0D + Information->Product =3D AllocatePool (AsciiStrSize (Product) * sizeof= (CHAR16));=0D + AsciiStrToUnicodeStrS (Product, Information->Product, AsciiStrSize (Pr= oduct) * sizeof (CHAR16));=0D + Information->ProductVer =3D AllocatePool (AsciiStrSize (ProductVer) * = sizeof (CHAR16));=0D + AsciiStrToUnicodeStrS (ProductVer, Information->ProductVer, AsciiStrSi= ze (ProductVer) * sizeof (CHAR16));=0D DEBUG ((DEBUG_MANAGEABILITY, "Redfish service product: %s, Version:%s.= \n", Information->Product, Information->ProductVer));=0D }=0D }=0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112870): https://edk2.groups.io/g/devel/message/112870 Mute This Topic: https://groups.io/mt/103354130/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-