From: "Chang, Abner" <abner.chang@amd.com>
To: <devel@edk2.groups.io>
Cc: Isaac Oram <isaac.w.oram@intel.com>,
Abdul Lateef Attar <abdattar@amd.com>,
Nickle Wang <nicklew@nvidia.com>,
Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-platforms][PATCH 03/14] ManageabilityPkg: Fix Uncrustify errors
Date: Mon, 3 Apr 2023 23:04:48 +0800 [thread overview]
Message-ID: <20230403150459.925-4-abner.chang@amd.com> (raw)
In-Reply-To: <20230403150459.925-1-abner.chang@amd.com>
From: Abner Chang <abner.chang@amd.com>
Fix Uncrustify errors of IPMI protocol
and KCS manageability transport library.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <abdattar@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../Library/ManageabilityTransportLib.h | 8 ++--
.../IpmiProtocol/Pei/IpmiPpiInternal.h | 10 ++---
.../Dxe/ManageabilityTransportKcs.c | 6 ++-
.../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 4 +-
.../Universal/IpmiProtocol/Pei/IpmiPpi.c | 40 ++++++++++---------
.../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 7 ++--
6 files changed, 41 insertions(+), 34 deletions(-)
diff --git a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
index ad6cd1a464..d86d0d87d5 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
@@ -74,13 +74,13 @@ typedef UINT32 MANAGEABILITY_TRANSPORT_CAPABILITY;
/// Bit 0
#define MANAGEABILITY_TRANSPORT_CAPABILITY_MULTIPLE_TRANSFER_TOKENS 0x00000001
/// Bit 1
-#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER 0x00000002
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER 0x00000002
/// Bit 2 - Reserved
/// Bit 7:3 - Transport interface maximum payload size, which is (2 ^ bit[7:3] - 1)
/// bit[7:3] means no maximum payload.
-#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_MASK 0x000000f8
-#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_BIT_POSITION 3
- #define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE 0x00
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_MASK 0x000000f8
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_BIT_POSITION 3
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE 0x00
/// Bit 8:31 - Reserved
///
diff --git a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiInternal.h b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiInternal.h
index 7b6ab0f529..4b6bdc97a9 100644
--- a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiInternal.h
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiInternal.h
@@ -17,11 +17,11 @@
#define MANAGEABILITY_IPMI_PPI_INTERNAL_FROM_LINK(a) CR (a, PEI_IPMI_PPI_INTERNAL, PeiIpmiPpi, MANAGEABILITY_IPMI_PPI_INTERNAL_SIGNATURE)
typedef struct {
- UINT32 Signature;
- MANAGEABILITY_TRANSPORT_TOKEN *TransportToken;
- MANAGEABILITY_TRANSPORT_CAPABILITY TransportCapability;
- UINT32 TransportMaximumPayload;
- PEI_IPMI_PPI PeiIpmiPpi;
+ UINT32 Signature;
+ MANAGEABILITY_TRANSPORT_TOKEN *TransportToken;
+ MANAGEABILITY_TRANSPORT_CAPABILITY TransportCapability;
+ UINT32 TransportMaximumPayload;
+ PEI_IPMI_PPI PeiIpmiPpi;
} PEI_IPMI_PPI_INTERNAL;
#endif // MANAGEABILITY_IPMI_PPI_INTERNAL_H_
diff --git a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c
index 25d6e49886..91d3517bdb 100644
--- a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c
@@ -221,7 +221,7 @@ KcsTransportTransmitReceive (
EFI_STATUS Status;
MANAGEABILITY_IPMI_TRANSPORT_HEADER *TransmitHeader;
- if (TransportToken == NULL || TransferToken == NULL) {
+ if ((TransportToken == NULL) || (TransferToken == NULL)) {
DEBUG ((DEBUG_ERROR, "%a: Invalid transport token or transfer token.\n", __FUNCTION__));
return;
}
@@ -298,6 +298,7 @@ AcquireTransportSession (
DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for MANAGEABILITY_TRANSPORT_KCS\n", __FUNCTION__));
return EFI_OUT_OF_RESOURCES;
}
+
KcsTransportToken->Token.Transport = AllocateZeroPool (sizeof (MANAGEABILITY_TRANSPORT));
if (KcsTransportToken->Token.Transport == NULL) {
FreePool (KcsTransportToken);
@@ -346,9 +347,10 @@ GetTransportCapability (
OUT MANAGEABILITY_TRANSPORT_CAPABILITY *TransportCapability
)
{
- if (TransportToken == NULL || TransportCapability == NULL) {
+ if ((TransportToken == NULL) || (TransportCapability == NULL)) {
return EFI_INVALID_PARAMETER;
}
+
*TransportCapability = 0;
return EFI_SUCCESS;
}
diff --git a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
index c30132419d..40587a07af 100644
--- a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
@@ -100,12 +100,14 @@ DxeIpmiEntry (
DEBUG ((DEBUG_ERROR, "%a: Failed to acquire transport interface for IPMI protocol - %r\n", __FUNCTION__, Status));
return Status;
}
+
Status = GetTransportCapability (mTransportToken, &TransportCapability);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Failed to GetTransportCapability().\n", __FUNCTION__));
return Status;
}
- TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY(TransportCapability);
+
+ TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY (TransportCapability);
if (TransportMaximumPayload == (1 << MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE)) {
DEBUG ((DEBUG_INFO, "%a: Transport interface maximum payload is undefined.\n", __FUNCTION__));
} else {
diff --git a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
index 0dda6d2d47..0a914e513c 100644
--- a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
@@ -51,19 +51,19 @@ PeiIpmiSubmitCommand (
IN OUT UINT32 *ResponseDataSize
)
{
- EFI_STATUS Status;
- PEI_IPMI_PPI_INTERNAL *PeiIpmiPpiinternal;
-
- PeiIpmiPpiinternal = MANAGEABILITY_IPMI_PPI_INTERNAL_FROM_LINK(This);
- Status = CommonIpmiSubmitCommand (
- PeiIpmiPpiinternal->TransportToken,
- NetFunction,
- Command,
- RequestData,
- RequestDataSize,
- ResponseData,
- ResponseDataSize
- );
+ EFI_STATUS Status;
+ PEI_IPMI_PPI_INTERNAL *PeiIpmiPpiinternal;
+
+ PeiIpmiPpiinternal = MANAGEABILITY_IPMI_PPI_INTERNAL_FROM_LINK (This);
+ Status = CommonIpmiSubmitCommand (
+ PeiIpmiPpiinternal->TransportToken,
+ NetFunction,
+ Command,
+ RequestData,
+ RequestDataSize,
+ ResponseData,
+ ResponseDataSize
+ );
return Status;
}
@@ -90,18 +90,19 @@ PeiIpmiEntry (
MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS TransportAdditionalStatus;
MANAGEABILITY_TRANSPORT_HARDWARE_INFORMATION HardwareInformation;
- PeiIpmiPpiinternal = (PEI_IPMI_PPI_INTERNAL *)AllocateZeroPool (sizeof(PEI_IPMI_PPI_INTERNAL));
+ PeiIpmiPpiinternal = (PEI_IPMI_PPI_INTERNAL *)AllocateZeroPool (sizeof (PEI_IPMI_PPI_INTERNAL));
if (PeiIpmiPpiinternal == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Not enough memory for PEI_IPMI_PPI_INTERNAL.\n", __FUNCTION__));
return EFI_OUT_OF_RESOURCES;
}
- PpiDescriptor = (EFI_PEI_PPI_DESCRIPTOR *)AllocateZeroPool (sizeof(EFI_PEI_PPI_DESCRIPTOR));
+
+ PpiDescriptor = (EFI_PEI_PPI_DESCRIPTOR *)AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
if (PpiDescriptor == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_PEI_PPI_DESCRIPTOR.\n", __FUNCTION__));
return EFI_OUT_OF_RESOURCES;
}
- PeiIpmiPpiinternal->Signature = MANAGEABILITY_IPMI_PPI_INTERNAL_SIGNATURE;
+ PeiIpmiPpiinternal->Signature = MANAGEABILITY_IPMI_PPI_INTERNAL_SIGNATURE;
PeiIpmiPpiinternal->PeiIpmiPpi.IpmiSubmitCommand = PeiIpmiSubmitCommand;
PpiDescriptor->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
@@ -116,18 +117,19 @@ PeiIpmiEntry (
DEBUG ((DEBUG_ERROR, "%a: Failed to acquire transport interface for IPMI protocol - %r\n", __FUNCTION__, Status));
return Status;
}
+
Status = GetTransportCapability (PeiIpmiPpiinternal->TransportToken, &PeiIpmiPpiinternal->TransportCapability);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Failed to GetTransportCapability().\n", __FUNCTION__));
return Status;
}
- PeiIpmiPpiinternal->TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY(PeiIpmiPpiinternal->TransportCapability);
+ PeiIpmiPpiinternal->TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY (PeiIpmiPpiinternal->TransportCapability);
if (PeiIpmiPpiinternal->TransportMaximumPayload == (1 << MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE)) {
- DEBUG((DEBUG_INFO, "%a: Transport interface maximum payload is undefined.\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: Transport interface maximum payload is undefined.\n", __FUNCTION__));
} else {
PeiIpmiPpiinternal->TransportMaximumPayload -= 1;
- DEBUG((DEBUG_INFO, "%a: Transport interface for IPMI protocol has maximum payload 0x%x.\n", __FUNCTION__, PeiIpmiPpiinternal->TransportMaximumPayload));
+ DEBUG ((DEBUG_INFO, "%a: Transport interface for IPMI protocol has maximum payload 0x%x.\n", __FUNCTION__, PeiIpmiPpiinternal->TransportMaximumPayload));
}
TransportName = HelperManageabilitySpecName (PeiIpmiPpiinternal->TransportToken->Transport->ManageabilityTransportSpecification);
diff --git a/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c b/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c
index 86dee2fa24..41b9a10453 100644
--- a/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c
@@ -107,12 +107,13 @@ SmmIpmiEntry (
DEBUG ((DEBUG_ERROR, "%a: Failed to GetTransportCapability().\n", __FUNCTION__));
return Status;
}
- TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY(TransportCapability);
+
+ TransportMaximumPayload = MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY (TransportCapability);
if (TransportMaximumPayload == (1 << MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE)) {
- DEBUG((DEBUG_INFO, "%a: Transport interface maximum payload is undefined.\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: Transport interface maximum payload is undefined.\n", __FUNCTION__));
} else {
TransportMaximumPayload -= 1;
- DEBUG((DEBUG_INFO, "%a: Transport interface for IPMI protocol has maximum payload 0x%x.\n", __FUNCTION__, TransportMaximumPayload));
+ DEBUG ((DEBUG_INFO, "%a: Transport interface for IPMI protocol has maximum payload 0x%x.\n", __FUNCTION__, TransportMaximumPayload));
}
mTransportName = HelperManageabilitySpecName (mTransportToken->Transport->ManageabilityTransportSpecification);
--
2.37.1.windows.1
next prev parent reply other threads:[~2023-04-03 15:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 15:04 [edk2-platforms][PATCH 00/14] ManageabilityPkg part II Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 01/14] ManageabilityPkg: Add more helper functions Chang, Abner
2023-04-10 17:23 ` [edk2-devel] " Tinh Nguyen
2023-04-11 5:29 ` Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 02/14] ManageabilityPkg: Support Maximum Transfer Unit Chang, Abner
2023-04-03 15:04 ` Chang, Abner [this message]
2023-04-10 17:25 ` [edk2-devel] [edk2-platforms][PATCH 03/14] ManageabilityPkg: Fix Uncrustify errors Tinh Nguyen
2023-04-11 5:31 ` Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 04/14] ManageabilityPkg: Add HeaderSize and TrailerSize Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 05/14] ManageabilityPkg: Add PldmProtocolLib Chang, Abner
2023-04-11 13:41 ` Nickle Wang
2023-04-03 15:04 ` [edk2-platforms][PATCH 06/14] ManageabilityPkg: Add PldmSmbiosTransferDxe driver Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 07/14] ManageabilityPkg/KCS: KCS transport interface Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 08/14] ManageabilityPkg: Add definitions of MCTP Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 09/14] ManageabilityPkg/MctpProtocol: Add MctpProtocol Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 10/14] ManageabilityPkg: Add MCTP transport interface Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 11/14] ManageabilityPkg/PldmProtocol: Add PLDM protocol Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 12/14] ManageabilityPkg: Add Manageability PCDs Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 13/14] ManageabilityPkg: Relocate Manageability.dsc Chang, Abner
2023-04-10 17:27 ` Tinh Nguyen
2023-04-11 5:55 ` Chang, Abner
2023-04-03 15:04 ` [edk2-platforms][PATCH 14/14] ManageabilityPkg: Add Manageability FDFs Chang, Abner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230403150459.925-4-abner.chang@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox