mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ArmPkg/ArmScmiDxe: Use array indexing to access adjacent buffers
MessageParams1 and MessageParams2 always point to adjacent slots in the payload buffer, so no need to keep two separate pointers. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
c6db76402c
commit
956ef6cd8b
1 changed files with 4 additions and 7 deletions
|
|
@ -186,8 +186,7 @@ ClockDescribeRates (
|
|||
|
||||
UINT32 PayloadLength;
|
||||
SCMI_COMMAND Cmd;
|
||||
UINT32 *MessageParams1;
|
||||
UINT32 *MessageParams2;
|
||||
UINT32 *MessageParams;
|
||||
CLOCK_DESCRIBE_RATES *DescribeRates;
|
||||
CLOCK_RATE_DWORD *Rate;
|
||||
|
||||
|
|
@ -200,7 +199,7 @@ ClockDescribeRates (
|
|||
RequiredArraySize = 0;
|
||||
RateIndex = 0;
|
||||
|
||||
Status = ScmiCommandGetPayload (&MessageParams1);
|
||||
Status = ScmiCommandGetPayload (&MessageParams);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
|
@ -208,11 +207,9 @@ ClockDescribeRates (
|
|||
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||
Cmd.MessageId = ScmiMessageIdClockDescribeRates;
|
||||
|
||||
MessageParams2 = MessageParams1 + 1;
|
||||
|
||||
do {
|
||||
*MessageParams1 = ClockId;
|
||||
*MessageParams2 = RateIndex;
|
||||
MessageParams[0] = ClockId;
|
||||
MessageParams[1] = RateIndex;
|
||||
|
||||
// Set Payload length, note PayloadLength is a IN/OUT parameter.
|
||||
PayloadLength = sizeof (ClockId) + sizeof (RateIndex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue