From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 180C9740032 for ; Wed, 5 Feb 2025 22:09:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3lP7ZULCsDWmokLjbp2uF9ERINhlfvxlxqyEzGsCUjQ=; c=relaxed/simple; d=groups.io; h=Received-SPF: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:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240830; t=1738793375; v=1; x=1739052574; b=hy8QJcg7cgiGpl6WwZDBnF2r0wVp+qSQa8svfbCqE9V9Hfist2Y1QqsxCuhZFJENsRsFOuH1 dDnWOLct9rNR6u5iKM1rCxK5KGFhyH50GNjegaTZTsyjj0OE7EJi/w4MkgmN820Unl/AyDrTLH4 /uoo+urqk1RpB0+NdEYk6qRcDu7tJ364IhImr9UyWThII2c22tfwo8z5+ku5exdSi1KmkOHfSiS h9j14cyeUArkYI79yHt0zkNN7cAc5357EZlsPfW4JsV7JGtNr8B7YL+tlxWNQAbrCDbsP1ZNuGd M1cE6AoyYKtOKJfrkb6qe2hTtCenxeX9wovEi3LrxYpcQ== X-Received: by 127.0.0.2 with SMTP id Jwb4YY7687511x15BPZXt91I; Wed, 05 Feb 2025 14:09:34 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.85]) by mx.groups.io with SMTP id smtpd.web10.25650.1738793373639578577 for ; Wed, 05 Feb 2025 14:09:33 -0800 X-Received: from MN2PR07CA0025.namprd07.prod.outlook.com (2603:10b6:208:1a0::35) by CY5PR12MB6528.namprd12.prod.outlook.com (2603:10b6:930:43::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.24; Wed, 5 Feb 2025 22:09:29 +0000 X-Received: from BN2PEPF000055DA.namprd21.prod.outlook.com (2603:10b6:208:1a0:cafe::ce) by MN2PR07CA0025.outlook.office365.com (2603:10b6:208:1a0::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.28 via Frontend Transport; Wed, 5 Feb 2025 22:09:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000055DA.mail.protection.outlook.com (10.167.245.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.0 via Frontend Transport; Wed, 5 Feb 2025 22:09:28 +0000 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 5 Feb 2025 14:09:13 -0800 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Wed, 5 Feb 2025 14:09:12 -0800 X-Received: from NV-PF4WDED0.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Wed, 5 Feb 2025 14:09:12 -0800 From: "Girish Mahadevan via groups.io" To: , , , , , CC: , , , , Subject: [edk2-devel] [staging/dynamictables-reorg PATCH v0 01/12] DynamicTablesPkg: SmbiosStringLib: Add new helper macro Date: Wed, 5 Feb 2025 15:08:59 -0700 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DA:EE_|CY5PR12MB6528:EE_ X-MS-Office365-Filtering-Correlation-Id: a88b4cae-651c-4dd9-d54f-08dd4631c2ab X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qQYyZ9b9QJJFokwg56GamZBZllYAomN+HwneOrMkCVQsV1uZW8Yc/GbQbY29?= =?us-ascii?Q?k2McJzMp7/KxGN12pKgcGJc779/KIPS7Wd/0394vZEw7y8hzqowUSk4t9zBe?= =?us-ascii?Q?pzXJeHqFE7E3pZHopuEG2cTe34TfHzhG5GBTKyv7DUUEW42j69+9yJJucGUC?= =?us-ascii?Q?ILMGOJzhHWM5cKDGDrawPevKWMPIhXcMpaKHGaIhf3OSCFPfxGBkeaaubdfn?= =?us-ascii?Q?B9s3u9BPkocUheAaGrooaK9SDxjbCI0G4pM2hMxb5axD4gI1EncDpkCq14Gn?= =?us-ascii?Q?N+ee3T32GIqyEZdPPZCmklC7bqrkvmoTRalbro/DEQwCxj2/E0DGtqMJ8+zV?= =?us-ascii?Q?FcuvslW2ZYYiI0+Lqq0PzFplsC3DdnvV//uEmNBfKZou/MHVrpGR8DkMwrPr?= =?us-ascii?Q?bYWJbSKmhm4cJbWem147M0PbfExmkeWtNKBLiPC7yioJpWh/Wm1tWqwI6TfZ?= =?us-ascii?Q?hdtcVl890+GePyv6qAUkedMayoD3TqIMvLmGlvAqGs510wjmX2Uavw0Bq4fC?= =?us-ascii?Q?LuajmzmnHx3kjtY2EkFAef2U4iPUir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Y2HCBsEdWnPhIQdkfZVnLq0MCmqy5nWITWDKK8nWv1jn6ORToZlmR5O1j?= =?us-ascii?Q?5blch0Ohu9oX4aY=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2025 22:09:28.7830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a88b4cae-651c-4dd9-d54f-08dd4631c2ab X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6528 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 Resent-Date: Wed, 05 Feb 2025 14:09:33 -0800 Resent-From: gmahadevan@nvidia.com Reply-To: devel@edk2.groups.io,gmahadevan@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: rD9nfRw3FEykJtVdtUZmX1xGx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=hy8QJcg7; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Add a new helper macro which is a wrapper over StringTableAddString(). It adds a string to the string table, and if the string is NULL or empty, add "" string instead. Signed-off-by: Dat Mach Signed-off-by: Nick Ramirez Signed-off-by: Girish Mahadevan --- .../Include/Library/SmbiosStringTableLib.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/SmbiosStringTableLib.h b/Dyna= micTablesPkg/Include/Library/SmbiosStringTableLib.h index fb183d427f..b95d83f457 100644 --- a/DynamicTablesPkg/Include/Library/SmbiosStringTableLib.h +++ b/DynamicTablesPkg/Include/Library/SmbiosStringTableLib.h @@ -2,6 +2,7 @@ SMBIOS String Table Helper library. =20 Copyright (c) 2022, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -116,4 +117,23 @@ StringTableFree ( IN STRING_TABLE *CONST StrTable ); =20 +/** STRING_TABLE_ADD_STRING macro is the wrapper over StringTableAddString= (). + It adds a string to the string table, and if the string is NULL or emp= ty, + add "" string instead. + + @param [IN] StrTable Pointer to the string table + @param [IN] Str Pointer to the string + @param [OUT] StrRef The string field reference of the added string +**/ +#define STRING_TABLE_ADD_STRING(StrTable, String, StringRef) = \ + StringRef =3D 0; = \ + if ((String !=3D NULL) && (String[0] !=3D '\0')) { = \ + Status =3D StringTableAddString (&StrTable, String, &StringRef); = \ + } else { = \ + Status =3D StringTableAddString (&StrTable, "", &StringRef); \ + } = \ + if (EFI_ERROR (Status)) { = \ + DEBUG ((DEBUG_ERROR, "Failed to add "#String" string %r\n", Status)); = \ + } = \ + #endif // SMBIOS_STRING_TABLE_H_ --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121084): https://edk2.groups.io/g/devel/message/121084 Mute This Topic: https://groups.io/mt/111022000/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-