From nobody Tue Nov 25 18:17:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dG9sG0cS7z6HZ10 for ; Tue, 25 Nov 2025 18:17:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dG9sF5ZnNz412R for ; Tue, 25 Nov 2025 18:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764094657; 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; bh=IyQcE99OrcXWIXM//LbtTYa+ONakH9scKwuHJQC8jMo=; b=O51jqiCOoYmwD9Zf675nAjC0AusHVgSA3HEPQenXaIdyVOTAJULcOu0VO+SSMkUHHGu3Xg NPgJZxi5drMz69WEW22O4tPFWyEe7z72ex3YWy95EfkK3+PZlj6ai99rbTHXcBDyqPOYKB ll1qbjHpWLez1YS7CQI1J04Pr4Feg+dubAGjQjeZDIKGjPOw46jFRVqtg+yj6VtMYCDrj6 +Xz2wMyU+E8wpbJI0HrEUx+vhM0FZEsMSC16D7+MYkvuM5q314idoDeDtaSP9qCyeoXks8 ZsgMp0N2bhfAyhuarWpEaOVaWWNHUINEX0nx7j/jU+v8zNYdn1m6i/PzUfwKZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764094657; 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; bh=IyQcE99OrcXWIXM//LbtTYa+ONakH9scKwuHJQC8jMo=; b=iB9elqQVfcKgvp8HgZJV9QqSJqCopkJibLSoZIqaSrPkKNPa33qr32RT5MKHn88tISUjGB fX+F6rz0Al2VTHPYZj348xtkb3XMqTjlp3iamr9z9gsDDNC62xGZeuVmin3Q4JfPjunFi2 edFrqW53yfPu4zFgtiOOma6se622p/RPosGVJAF1s6oIY3J2uXYEsNpK80tTLzWad8zZe8 aLaJOEflshImIQLrsfA8cTJFVTnYvAq/X9K5Y5coQEO2193KWb4+QjSWO90oEPHzz57ZOt 6P7w2+2OELeTjm+tUUOr0k3IEla8wZzrMf9yCdCBvpsmB7jXIbNnkp3f8I7QoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764094657; a=rsa-sha256; cv=none; b=xjnFdla0VI00QNH+LVB8mR1EIicpH6HajYyh7SL8odXg6GMWMwhbbpa3uJtJZ4/WVEc4OS +AFF4wmy0IvAXV5oi+F7J2VLkBKL4Uc8sDrPzVtqLH91AktE6rAPo9u767y43fze3l3E2e /NQYThOOM4slhmt/6WVt9U+ACaoZoaDrlD7WWiLGKwwxqiaq8TFqV1kSla2mddpbjfYhlo UWPsNfTs1SvsNGlhrpPtqmw0oGxf+M9KTcDKTDliIb6sG7Rwg1IsexcMpwVYm67ypzHIm2 VIAFeDI6C6jESXAVzg6C1ic/Y7XATGGDXvq9qK0sQ7aXL9o9pqmlJd/vUpzl7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dG9sF56lWz1B08 for ; Tue, 25 Nov 2025 18:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e60f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 18:17:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Jose Luis Duran From: Warner Losh Subject: git: 8494a3de2c50 - main - libefivar: Apply uncrustify changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8494a3de2c50e9d066b9e0b043306a49b932e025 Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 18:17:37 +0000 Message-Id: <6925f2c1.e60f.3af9c023@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8494a3de2c50e9d066b9e0b043306a49b932e025 commit 8494a3de2c50e9d066b9e0b043306a49b932e025 Author: Jose Luis Duran AuthorDate: 2025-11-13 17:16:55 +0000 Commit: Warner Losh CommitDate: 2025-11-25 18:17:25 +0000 libefivar: Apply uncrustify changes REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdePkg package Note that the link above no longer exists. The commit message was kept verbatim. An original copy of the bug report can be found at: https://web.archive.org/web/20241008121707/https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Obtained from: https://github.com/tianocore/edk2/commit/2f88bd3a1296c522317f1c21377876de63de5be7 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894 --- lib/libefivar/uefi-dputil.c | 102 ++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/lib/libefivar/uefi-dputil.c b/lib/libefivar/uefi-dputil.c index 93ff4d9ac8ba..da87bffb7bd5 100644 --- a/lib/libefivar/uefi-dputil.c +++ b/lib/libefivar/uefi-dputil.c @@ -37,7 +37,7 @@ /* * Taken from MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c - * hash d0e2f8232a26453fc0191629ed44ff2a46ea073e 2021-Dec-07 + * hash 2f88bd3a1296c522317f1c21377876de63de5be7 2021-Dec-07 */ /** @file @@ -88,18 +88,18 @@ static CONST EFI_DEVICE_PATH_PROTOCOL mUefiDevicePathLibEndDevicePath = { BOOLEAN EFIAPI IsDevicePathValid ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN UINTN MaxSize + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN UINTN MaxSize ) { - UINTN Count; - UINTN Size; - UINTN NodeLength; + UINTN Count; + UINTN Size; + UINTN NodeLength; // - //Validate the input whether exists and its size big enough to touch the first node + // Validate the input whether exists and its size big enough to touch the first node // - if (DevicePath == NULL || (MaxSize > 0 && MaxSize < END_DEVICE_PATH_LENGTH)) { + if ((DevicePath == NULL) || ((MaxSize > 0) && (MaxSize < END_DEVICE_PATH_LENGTH))) { return FALSE; } @@ -116,6 +116,7 @@ IsDevicePathValid ( if (NodeLength > MAX_UINTN - Size) { return FALSE; } + Size += NodeLength; // @@ -135,9 +136,10 @@ IsDevicePathValid ( // // FilePath must be a NULL-terminated string. // - if (DevicePathType (DevicePath) == MEDIA_DEVICE_PATH && - DevicePathSubType (DevicePath) == MEDIA_FILEPATH_DP && - *(const CHAR16 *)((const UINT8 *) DevicePath + NodeLength - 2) != 0) { + if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && + (DevicePathSubType (DevicePath) == MEDIA_FILEPATH_DP) && + (*(const CHAR16 *)((const UINT8 *) DevicePath + NodeLength - 2) != 0)) + { return FALSE; } } @@ -145,7 +147,7 @@ IsDevicePathValid ( // // Only return TRUE when the End Device Path node is valid. // - return (BOOLEAN) (DevicePathNodeLength (DevicePath) == END_DEVICE_PATH_LENGTH); + return (BOOLEAN)(DevicePathNodeLength (DevicePath) == END_DEVICE_PATH_LENGTH); } /** @@ -240,7 +242,7 @@ NextDevicePathNode ( ) { ASSERT (Node != NULL); - return ((EFI_DEVICE_PATH_PROTOCOL *)(__DECONST(UINT8 *, Node) + DevicePathNodeLength(Node))); + return (EFI_DEVICE_PATH_PROTOCOL *)(__DECONST(UINT8 *, Node) + DevicePathNodeLength (Node)); } /** @@ -270,7 +272,7 @@ IsDevicePathEndType ( ) { ASSERT (Node != NULL); - return (BOOLEAN) (DevicePathType (Node) == END_DEVICE_PATH_TYPE); + return (BOOLEAN)(DevicePathType (Node) == END_DEVICE_PATH_TYPE); } /** @@ -297,7 +299,7 @@ IsDevicePathEnd ( ) { ASSERT (Node != NULL); - return (BOOLEAN) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE); + return (BOOLEAN)(IsDevicePathEndType (Node) && DevicePathSubType (Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE); } #ifndef __FreeBSD__ @@ -325,7 +327,7 @@ IsDevicePathEndInstance ( ) { ASSERT (Node != NULL); - return (BOOLEAN) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE); + return (BOOLEAN)(IsDevicePathEndType (Node) && DevicePathSubType (Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE); } #endif @@ -427,7 +429,7 @@ GetDevicePathSize ( // // Compute the size and add back in the size of the end device path structure // - return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath); + return ((UINTN)DevicePath - (UINTN)Start) + DevicePathNodeLength (DevicePath); } /** @@ -452,7 +454,7 @@ DuplicateDevicePath ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) { - UINTN Size; + UINTN Size; // // Compute the size @@ -525,9 +527,9 @@ AppendDevicePath ( // Allocate space for the combined device path. It only has one end node of // length EFI_DEVICE_PATH_PROTOCOL. // - Size1 = GetDevicePathSize (FirstDevicePath); - Size2 = GetDevicePathSize (SecondDevicePath); - Size = Size1 + Size2 - END_DEVICE_PATH_LENGTH; + Size1 = GetDevicePathSize (FirstDevicePath); + Size2 = GetDevicePathSize (SecondDevicePath); + Size = Size1 + Size2 - END_DEVICE_PATH_LENGTH; NewDevicePath = AllocatePool (Size); @@ -536,8 +538,8 @@ AppendDevicePath ( // // Over write FirstDevicePath EndNode and do the copy // - DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + - (Size1 - END_DEVICE_PATH_LENGTH)); + DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *)((CHAR8 *)NewDevicePath + + (Size1 - END_DEVICE_PATH_LENGTH)); CopyMem (DevicePath2, SecondDevicePath, Size2); } @@ -587,6 +589,7 @@ AppendDevicePathNode ( if (DevicePathNode == NULL) { return DuplicateDevicePath ((DevicePath != NULL) ? DevicePath : &mUefiDevicePathLibEndDevicePath); } + // // Build a Node that has a terminator on it // @@ -596,6 +599,7 @@ AppendDevicePathNode ( if (TempDevicePath == NULL) { return NULL; } + TempDevicePath = CopyMem (TempDevicePath, DevicePathNode, NodeLength); // // Add and end device path node to convert Node to device path @@ -660,20 +664,19 @@ UefiDevicePathLibAppendDevicePathInstance ( return NULL; } - SrcSize = GetDevicePathSize (DevicePath); - InstanceSize = GetDevicePathSize (DevicePathInstance); + SrcSize = GetDevicePathSize (DevicePath); + InstanceSize = GetDevicePathSize (DevicePathInstance); NewDevicePath = AllocatePool (SrcSize + InstanceSize); if (NewDevicePath != NULL) { - - TempDevicePath = CopyMem (NewDevicePath, DevicePath, SrcSize);; + TempDevicePath = CopyMem (NewDevicePath, DevicePath, SrcSize); while (!IsDevicePathEnd (TempDevicePath)) { TempDevicePath = NextDevicePathNode (TempDevicePath); } - TempDevicePath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; - TempDevicePath = NextDevicePathNode (TempDevicePath); + TempDevicePath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; + TempDevicePath = NextDevicePathNode (TempDevicePath); CopyMem (TempDevicePath, DevicePathInstance, InstanceSize); } @@ -711,8 +714,8 @@ UefiDevicePathLibAppendDevicePathInstance ( EFI_DEVICE_PATH_PROTOCOL * EFIAPI UefiDevicePathLibGetNextDevicePathInstance ( - IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, - OUT UINTN *Size + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, + OUT UINTN *Size ) { EFI_DEVICE_PATH_PROTOCOL *DevPath; @@ -721,7 +724,7 @@ UefiDevicePathLibGetNextDevicePathInstance ( ASSERT (Size != NULL); - if (DevicePath == NULL || *DevicePath == NULL) { + if ((DevicePath == NULL) || (*DevicePath == NULL)) { *Size = 0; return NULL; } @@ -741,15 +744,15 @@ UefiDevicePathLibGetNextDevicePathInstance ( // // Compute the size of the device path instance // - *Size = ((UINTN) DevPath - (UINTN) (*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL); + *Size = ((UINTN)DevPath - (UINTN)(*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL); // // Make a copy and return the device path instance // - Temp = DevPath->SubType; - DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; - ReturnValue = DuplicateDevicePath (*DevicePath); - DevPath->SubType = Temp; + Temp = DevPath->SubType; + DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; + ReturnValue = DuplicateDevicePath (*DevicePath); + DevPath->SubType = Temp; // // If DevPath is the end of an entire device path, then another instance @@ -787,12 +790,12 @@ UefiDevicePathLibGetNextDevicePathInstance ( EFI_DEVICE_PATH_PROTOCOL * EFIAPI CreateDeviceNode ( - IN UINT8 NodeType, - IN UINT8 NodeSubType, - IN UINT16 NodeLength + IN UINT8 NodeType, + IN UINT8 NodeSubType, + IN UINT16 NodeLength ) { - EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; if (NodeLength < sizeof (EFI_DEVICE_PATH_PROTOCOL)) { // @@ -803,9 +806,9 @@ CreateDeviceNode ( DevicePath = AllocateZeroPool (NodeLength); if (DevicePath != NULL) { - DevicePath->Type = NodeType; - DevicePath->SubType = NodeSubType; - SetDevicePathNodeLength (DevicePath, NodeLength); + DevicePath->Type = NodeType; + DevicePath->SubType = NodeSubType; + SetDevicePathNodeLength (DevicePath, NodeLength); } return DevicePath; @@ -833,7 +836,7 @@ UefiDevicePathLibIsDevicePathMultiInstance ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) { - CONST EFI_DEVICE_PATH_PROTOCOL *Node; + CONST EFI_DEVICE_PATH_PROTOCOL *Node; if (DevicePath == NULL) { return FALSE; @@ -855,7 +858,6 @@ UefiDevicePathLibIsDevicePathMultiInstance ( return FALSE; } - /** Allocates a device path for a file and appends it to an existing device path. @@ -880,8 +882,8 @@ UefiDevicePathLibIsDevicePathMultiInstance ( EFI_DEVICE_PATH_PROTOCOL * EFIAPI FileDevicePath ( - IN EFI_HANDLE Device OPTIONAL, - IN CONST CHAR16 *FileName + IN EFI_HANDLE Device OPTIONAL, + IN CONST CHAR16 *FileName ) { UINTN Size; @@ -891,10 +893,10 @@ FileDevicePath ( DevicePath = NULL; - Size = StrSize (FileName); + Size = StrSize (FileName); FileDevicePath = AllocatePool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + END_DEVICE_PATH_LENGTH); if (FileDevicePath != NULL) { - FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePath; + FilePath = (FILEPATH_DEVICE_PATH *)FileDevicePath; FilePath->Header.Type = MEDIA_DEVICE_PATH; FilePath->Header.SubType = MEDIA_FILEPATH_DP; CopyMem (&FilePath->PathName, FileName, Size);