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 D805AD8023C for ; Thu, 26 Oct 2023 09:50:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=glW/5UTQp1FR0IDNQZknsbUGRYpZB0tjK2EaIXU2Oy0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698313841; v=1; b=WnNVwxEP/W4jZmQXTybuo8yVT3SDAqKToZ+96RmAy7ITRKV29VF7YsyvhXCDCfzkiRpkEFoK hQWv+RtQnOmcKtPdebPC2j01nhFTqhOTJ/HqPhNgIKF1weZ9oA92x4/FCXv5vG0ngJN9BswleIT mTt4siUeFkwx+eV3vhZnvUlI= X-Received: by 127.0.0.2 with SMTP id EyvBYY7687511x1Km8vb4VX6; Thu, 26 Oct 2023 02:50:41 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.66918.1698313840840344910 for ; Thu, 26 Oct 2023 02:50:41 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-9zkHOzWxPxeOtd9YbL7qaw-1; Thu, 26 Oct 2023 05:50:29 -0400 X-MC-Unique: 9zkHOzWxPxeOtd9YbL7qaw-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 327993806066; Thu, 26 Oct 2023 09:50:29 +0000 (UTC) X-Received: from [10.39.192.119] (unknown [10.39.192.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF81E502A; Thu, 26 Oct 2023 09:50:27 +0000 (UTC) Message-ID: <0fe32c67-6103-5254-05b7-d42a1c7df2b4@redhat.com> Date: Thu, 26 Oct 2023 11:50:26 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: Uncrustify on C source files To: devel@edk2.groups.io, abner.chang@amd.com Cc: Abdul Lateef Attar , Nickle Wang , Konstantin Aladyshev References: <20231026080607.1904-1-abner.chang@amd.com> From: "Laszlo Ersek" In-Reply-To: <20231026080607.1904-1-abner.chang@amd.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: CCIPRbFBCCpJJTs7H96PMEZTx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=WnNVwxEP; 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=redhat.com (policy=none) On 10/26/23 10:06, Chang, Abner via groups.io wrote: > From: Abner Chang >=20 > Run Uncrustify on the C source files those were > modified in commit ID from 3f4c4384 to 28ff8f29. >=20 > Signed-off-by: Abner Chang > Cc: Abdul Lateef Attar > Cc: Nickle Wang > Cc: Konstantin Aladyshev > --- > .../Include/Library/BasePldmProtocolLib.h | 6 ++--- > .../PldmProtocol/Common/PldmProtocolCommon.h | 4 ++-- > .../Common/KcsCommon.c | 2 +- > .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c | 10 ++++----- > .../MctpProtocol/Common/MctpProtocolCommon.c | 22 ++++++++++++------- > .../Universal/MctpProtocol/Dxe/MctpProtocol.c | 6 +++-- > .../PldmProtocol/Common/PldmProtocolCommon.c | 12 +++++----- > .../Universal/PldmProtocol/Dxe/PldmProtocol.c | 8 +++---- > .../PldmSmbiosTransferDxe.c | 2 +- > 9 files changed, 40 insertions(+), 32 deletions(-) >=20 > diff --git a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLi= b.h b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h > index a698197263..404474a023 100644 > --- a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h > +++ b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h > @@ -21,9 +21,9 @@ > **/ > EFI_STATUS > PldmSetTerminus ( > - IN UINT8 SourceId, > - IN UINT8 DestinationId > -); > + IN UINT8 SourceId, > + IN UINT8 DestinationId > + ); > =20 > /** > This service enables submitting commands via EDKII PLDM protocol. > diff --git a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/Pldm= ProtocolCommon.h b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/= PldmProtocolCommon.h > index eb273c4f46..30f4d95847 100644 > --- a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtoco= lCommon.h > +++ b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtoco= lCommon.h > @@ -12,8 +12,8 @@ > #include > #include > =20 > -#define GET_PLDM_MESSAGE_PAYLOAD_SIZE(PayloadSize) (PayloadSize - sizeof= (PLDM_RESPONSE_HEADER)) > -#define GET_PLDM_MESSAGE_PAYLOAD_PTR(PayloadPtr) ((UINT8 *)PayloadPtr + = sizeof (PLDM_RESPONSE_HEADER)) > +#define GET_PLDM_MESSAGE_PAYLOAD_SIZE(PayloadSize) (PayloadSize - sizeo= f (PLDM_RESPONSE_HEADER)) > +#define GET_PLDM_MESSAGE_PAYLOAD_PTR(PayloadPtr) ((UINT8 *)PayloadPtr= + sizeof (PLDM_RESPONSE_HEADER)) > =20 > typedef struct { > UINT8 PldmType; > diff --git a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsL= ib/Common/KcsCommon.c b/Features/ManageabilityPkg/Library/ManageabilityTran= sportKcsLib/Common/KcsCommon.c > index 4f7e7d450f..d80267cb57 100644 > --- a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Comm= on/KcsCommon.c > +++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Comm= on/KcsCommon.c > @@ -496,7 +496,6 @@ KcsReadResponseHeader ( > =20 > *ResponseHeader =3D NULL; > if (CompareGuid (&gManageabilityProtocolMctpGuid, mSingleSessionToken-= >Token.ManageabilityProtocolSpecification)) { > - > // For MCTP over KCS > ExpectedHeaderSize =3D sizeof (MANAGEABILITY_MCTP_KCS_HEADER); > DEBUG (( > @@ -711,6 +710,7 @@ KcsTransportSendCommand ( > =20 > *ResponseDataSize =3D ((MANAGEABILITY_MCTP_KCS_HEADER *)RspHeader)= ->ByteCount; > } > + > FreePool (RspHeader); > =20 > ExpectedResponseDataSize =3D *ResponseDataSize; > diff --git a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/Pl= dmProtocolLib.c b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe= /PldmProtocolLib.c > index 37231b0756..9e1e664d6b 100644 > --- a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProto= colLib.c > +++ b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProto= colLib.c > @@ -29,9 +29,9 @@ UINT8 mDestinationPldmTerminusId =3D 0; > **/ > EFI_STATUS > PldmSetTerminus ( > - IN UINT8 SourceId, > - IN UINT8 DestinationId > -) > + IN UINT8 SourceId, > + IN UINT8 DestinationId > + ) > { > mSourcePldmTerminusId =3D SourceId; > mDestinationPldmTerminusId =3D DestinationId; > @@ -111,6 +111,7 @@ PldmSubmitCommand ( > =20 > return Status; > } > + > /** > =20 > Initialize mSourcePldmTerminusId and mDestinationPldmTerminusId. > @@ -128,7 +129,6 @@ PldmProtocolLibConstructor ( > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > - > - PldmSetTerminus (PcdGet8(PcdPldmSourceTerminusId), PcdGet8(PcdPldmDest= inationEndpointId)); > + PldmSetTerminus (PcdGet8 (PcdPldmSourceTerminusId), PcdGet8 (PcdPldmDe= stinationEndpointId)); > return EFI_SUCCESS; > } > diff --git a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/Mctp= ProtocolCommon.c b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/= MctpProtocolCommon.c > index 3709ab16eb..5509ed5ada 100644 > --- a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtoco= lCommon.c > +++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtoco= lCommon.c > @@ -129,11 +129,11 @@ SetupMctpRequestTransportPacket ( > OUT UINT16 *PacketTrailerSize > ) > { > - MANAGEABILITY_MCTP_KCS_HEADER *MctpKcsHeader; > - MCTP_TRANSPORT_HEADER *MctpTransportHeader; > - MCTP_MESSAGE_HEADER *MctpMessageHeader; > - MANAGEABILITY_MCTP_KCS_TRAILER *MctpKcsTrailer; > - UINT8 *ThisPackage; > + MANAGEABILITY_MCTP_KCS_HEADER *MctpKcsHeader; > + MCTP_TRANSPORT_HEADER *MctpTransportHeader; > + MCTP_MESSAGE_HEADER *MctpMessageHeader; > + MANAGEABILITY_MCTP_KCS_TRAILER *MctpKcsTrailer; > + UINT8 *ThisPackage; > =20 > if ((PacketHeader =3D=3D NULL) || (PacketHeaderSize =3D=3D NULL) || > (PacketBody =3D=3D NULL) || (PacketBodySize =3D=3D NULL) || > @@ -462,7 +462,7 @@ CommonMctpSubmitMessage ( > ); > =20 > *AdditionalTransferError =3D TransferToken.TransportAdditionalStatus; > - Status =3D TransferToken.TransferStatus; > + Status =3D TransferToken.TransferStatus; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: Failed to send MCTP command over %s: %r\n"= , __func__, mTransportName, Status)); > return Status; > @@ -480,6 +480,7 @@ CommonMctpSubmitMessage ( > FreePool (ResponseBuffer); > return EFI_DEVICE_ERROR; > } > + > if (MctpTransportResponseHeader->Bits.MessageTag !=3D MCTP_MESSAGE_TAG= ) { > DEBUG (( > DEBUG_ERROR, > @@ -491,6 +492,7 @@ CommonMctpSubmitMessage ( > FreePool (ResponseBuffer); > return EFI_DEVICE_ERROR; > } > + > if (MctpTransportResponseHeader->Bits.TagOwner !=3D MCTP_MESSAGE_TAG_O= WNER_RESPONSE) { > DEBUG (( > DEBUG_ERROR, > @@ -502,6 +504,7 @@ CommonMctpSubmitMessage ( > FreePool (ResponseBuffer); > return EFI_DEVICE_ERROR; > } > + > if (MctpTransportResponseHeader->Bits.SourceEndpointId !=3D MctpDestin= ationEndpointId) { > DEBUG (( > DEBUG_ERROR, > @@ -513,6 +516,7 @@ CommonMctpSubmitMessage ( > FreePool (ResponseBuffer); > return EFI_DEVICE_ERROR; > } > + > if (MctpTransportResponseHeader->Bits.DestinationEndpointId !=3D MctpS= ourceEndpointId) { > DEBUG (( > DEBUG_ERROR, > @@ -524,9 +528,11 @@ CommonMctpSubmitMessage ( > FreePool (ResponseBuffer); > return EFI_DEVICE_ERROR; > } > + > if ((MctpTransportResponseHeader->Bits.StartOfMessage !=3D 1) || > (MctpTransportResponseHeader->Bits.EndOfMessage !=3D 1) || > - (MctpTransportResponseHeader->Bits.PacketSequence !=3D 0)) { > + (MctpTransportResponseHeader->Bits.PacketSequence !=3D 0)) > + { > DEBUG (( > DEBUG_ERROR, > "%a: Error! Multiple-packet MCTP responses are not supported by th= e current driver\n", > @@ -561,7 +567,7 @@ CommonMctpSubmitMessage ( > return EFI_DEVICE_ERROR; > } > =20 > - *ResponseDataSize =3D TransferToken.ReceivePackage.ReceiveSizeI= nByte - sizeof (MCTP_TRANSPORT_HEADER) - sizeof (MCTP_MESSAGE_HEADER); > + *ResponseDataSize =3D TransferToken.ReceivePackage.ReceiveSizeInByte -= sizeof (MCTP_TRANSPORT_HEADER) - sizeof (MCTP_MESSAGE_HEADER); > CopyMem (ResponseData, ResponseBuffer + sizeof (MCTP_TRANSPORT_HEADER)= + sizeof (MCTP_MESSAGE_HEADER), *ResponseDataSize); > FreePool (ResponseBuffer); > =20 > diff --git a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpPro= tocol.c b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol= .c > index 73445bf816..a133341906 100644 > --- a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c > +++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c > @@ -105,14 +105,16 @@ MctpSubmitMessage ( > // > if ((SourceEid >=3D MCTP_RESERVED_ENDPOINT_START_ID) && > (SourceEid <=3D MCTP_RESERVED_ENDPOINT_END_ID) > - ) { > + ) > + { > DEBUG ((DEBUG_ERROR, "%a: The value of MCTP source EID (%x) is reser= ved.\n", __func__, MctpSourceEndpointId)); > return EFI_INVALID_PARAMETER; > } > =20 > if ((DestinationEid >=3D MCTP_RESERVED_ENDPOINT_START_ID) && > (DestinationEid <=3D MCTP_RESERVED_ENDPOINT_END_ID) > - ) { > + ) > + { > DEBUG ((DEBUG_ERROR, "%a: The value of MCTP destination EID (%x) is = reserved.\n", __func__, MctpDestinationEndpointId)); > return EFI_INVALID_PARAMETER; > } > diff --git a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/Pldm= ProtocolCommon.c b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/= PldmProtocolCommon.c > index 2f2f76603e..bb38520ec0 100644 > --- a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtoco= lCommon.c > +++ b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtoco= lCommon.c > @@ -231,7 +231,7 @@ CommonPldmSubmitCommand ( > TransferToken.TransmitPackage.TransmitTimeoutInMillisecond =3D MANAGEA= BILITY_TRANSPORT_NO_TIMEOUT; > =20 > // Set receive packet. > - if (ResponseData =3D=3D NULL && *ResponseDataSize =3D=3D 0) { > + if ((ResponseData =3D=3D NULL) && (*ResponseDataSize =3D=3D 0)) { > FullPacketResponseDataSize =3D sizeof (PLDM_RESPONSE_HEADER); > } else { > FullPacketResponseDataSize =3D *ResponseDataSize + sizeof (PLDM_RESP= ONSE_HEADER); > @@ -326,16 +326,16 @@ CommonPldmSubmitCommand ( > goto ErrorExit; > } > =20 > - if (*ResponseDataSize < GET_PLDM_MESSAGE_PAYLOAD_SIZE(TransferToken.Re= ceivePackage.ReceiveSizeInByte)) { > + if (*ResponseDataSize < GET_PLDM_MESSAGE_PAYLOAD_SIZE (TransferToken.R= eceivePackage.ReceiveSizeInByte)) { > DEBUG ((DEBUG_ERROR, " The size of response is not matched to Reque= stDataSize assigned by caller.\n")); > DEBUG (( > DEBUG_ERROR, > "Caller expects %d, the response size minus PLDM_RESPONSE_HEADER s= ize is %d, Completion Code %d.\n", > *ResponseDataSize, > - GET_PLDM_MESSAGE_PAYLOAD_SIZE(TransferToken.ReceivePackage.Receive= SizeInByte), > + GET_PLDM_MESSAGE_PAYLOAD_SIZE (TransferToken.ReceivePackage.Receiv= eSizeInByte), > ResponseHeader->PldmCompletionCode > )); > - HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, GET_P= LDM_MESSAGE_PAYLOAD_SIZE(TransferToken.ReceivePackage.ReceiveSizeInByte), "= Failed response payload\n"); > + HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, GET_P= LDM_MESSAGE_PAYLOAD_SIZE (TransferToken.ReceivePackage.ReceiveSizeInByte), = "Failed response payload\n"); > Status =3D EFI_DEVICE_ERROR; > goto ErrorExit; > } > @@ -345,10 +345,10 @@ CommonPldmSubmitCommand ( > =20 > // Copy response data (without header) to caller's buffer. > if ((ResponseData !=3D NULL) && (*ResponseDataSize !=3D 0)) { > - *ResponseDataSize =3D GET_PLDM_MESSAGE_PAYLOAD_SIZE(TransferToken.Re= ceivePackage.ReceiveSizeInByte); > + *ResponseDataSize =3D GET_PLDM_MESSAGE_PAYLOAD_SIZE (TransferToken.R= eceivePackage.ReceiveSizeInByte); > CopyMem ( > (VOID *)ResponseData, > - GET_PLDM_MESSAGE_PAYLOAD_PTR(FullPacketResponseData), > + GET_PLDM_MESSAGE_PAYLOAD_PTR (FullPacketResponseData), > *ResponseDataSize > ); > } > diff --git a/Features/ManageabilityPkg/Universal/PldmProtocol/Dxe/PldmPro= tocol.c b/Features/ManageabilityPkg/Universal/PldmProtocol/Dxe/PldmProtocol= .c > index 058f98e677..fce8029b9c 100644 > --- a/Features/ManageabilityPkg/Universal/PldmProtocol/Dxe/PldmProtocol.c > +++ b/Features/ManageabilityPkg/Universal/PldmProtocol/Dxe/PldmProtocol.c > @@ -63,7 +63,7 @@ PldmSubmitCommand ( > // > // Check the given input parameters. > // > - if (RequestData =3D=3D NULL && RequestDataSize !=3D 0) { > + if ((RequestData =3D=3D NULL) && (RequestDataSize !=3D 0)) { > DEBUG (( > DEBUG_ERROR, > "%a: RequestDataSize !=3D 0, however RequestData is NULL for PLDM = type: 0x%x, Command: 0x%x.\n", > @@ -74,7 +74,7 @@ PldmSubmitCommand ( > return EFI_INVALID_PARAMETER; > } > =20 > - if (RequestData !=3D NULL && RequestDataSize =3D=3D 0) { > + if ((RequestData !=3D NULL) && (RequestDataSize =3D=3D 0)) { > DEBUG (( > DEBUG_ERROR, > "%a: RequestDataSize =3D=3D 0, however RequestData is not NULL for= PLDM type: 0x%x, Command: 0x%x.\n", > @@ -85,7 +85,7 @@ PldmSubmitCommand ( > return EFI_INVALID_PARAMETER; > } > =20 > - if (ResponseData =3D=3D NULL && *ResponseDataSize !=3D 0) { > + if ((ResponseData =3D=3D NULL) && (*ResponseDataSize !=3D 0)) { > DEBUG (( > DEBUG_ERROR, > "%a: *ResponseDataSize !=3D 0, however ResponseData is NULL for PL= DM type: 0x%x, Command: 0x%x.\n", > @@ -96,7 +96,7 @@ PldmSubmitCommand ( > return EFI_INVALID_PARAMETER; > } > =20 > - if (ResponseData !=3D NULL && *ResponseDataSize =3D=3D 0) { > + if ((ResponseData !=3D NULL) && (*ResponseDataSize =3D=3D 0)) { > DEBUG (( > DEBUG_ERROR, > "%a: *ResponseDataSize =3D=3D 0, however ResponseData is not NULL = for PLDM type: 0x%x, Command: 0x%x.\n", > diff --git a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/Pl= dmSmbiosTransferDxe.c b/Features/ManageabilityPkg/Universal/PldmSmbiosTrans= ferDxe/PldmSmbiosTransferDxe.c > index 357a7d49e4..81e9adf571 100644 > --- a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbio= sTransferDxe.c > +++ b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbio= sTransferDxe.c > @@ -49,7 +49,7 @@ SetPldmSmbiosTransferTerminusId ( > IN UINT8 DestinationId > ) > { > - return PldmSetTerminus(SourceId, DestinationId); > + return PldmSetTerminus (SourceId, DestinationId); > } > =20 > /** looks OK from a quick skim Acked-by: Laszlo Ersek -=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 (#110086): https://edk2.groups.io/g/devel/message/110086 Mute This Topic: https://groups.io/mt/102195867/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-