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 910AD740038 for ; Thu, 14 Dec 2023 23:25:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1tDGBYxrZPK8xAtNGDqglmN+zdMjoksXPBCprL37hSU=; 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=1702596315; v=1; b=FyzLYEUwygv3wegZ3Sx1kauXTH4DW41ej9LPD02d/FUJ493sKGb8OMYW9wAMb7MRuKMZVKBS PViTUSZKfEVDfdznAOnKrcz0yWYKUz7z9Qrm14Qnl5wKHB3Oi9Ph8Bd69RO75E2U20Cw4B/MtFW /iYyjlshTsTKzTviudiUAMTM= X-Received: by 127.0.0.2 with SMTP id blqlYY7687511xTo6Hz7QgQZ; Thu, 14 Dec 2023 15:25:15 -0800 X-Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mx.groups.io with SMTP id smtpd.web11.44959.1702596312232900959 for ; Thu, 14 Dec 2023 15:25:12 -0800 X-Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-50bfd8d5c77so37302e87.1 for ; Thu, 14 Dec 2023 15:25:11 -0800 (PST) X-Gm-Message-State: fI5YhaZo6w8CFjfEidovu5Cex7686176AA= X-Google-Smtp-Source: AGHT+IFEDV3hgcacFuF2rNunFu77GRFucxrR5JCX5Sjwbjzn4DDYuG7uPKko4KrKPPdOSLWvTHNYjA== X-Received: by 2002:a05:6512:23a7:b0:50d:1a10:d27f with SMTP id c39-20020a05651223a700b0050d1a10d27fmr3188562lfv.201.1702596310156; Thu, 14 Dec 2023 15:25:10 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id j24-20020ac24558000000b0050bfe5815e7sm1973119lfm.165.2023.12.14.15.25.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Dec 2023 15:25:09 -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 v2 11/14] RedfishDiscoverDxe: refine InitInformationData(), remove unnecessary casts Date: Fri, 15 Dec 2023 02:24:55 +0300 Message-Id: <20231214232458.4636-12-mike.maslenkin@gmail.com> In-Reply-To: <20231214232458.4636-1-mike.maslenkin@gmail.com> References: <20231214232458.4636-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=FyzLYEUw; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Cc: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Pedro Falcato Signed-off-by: Mike Maslenkin --- .../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 724aa35431a8..e3fc2d809dbc 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 (#112560): https://edk2.groups.io/g/devel/message/112560 Mute This Topic: https://groups.io/mt/103181047/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-