From 8dbf868e02c71b407e31f9b41b5266169c702812 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 28 Apr 2023 01:36:22 +0800 Subject: Add volatile keyword to NvmExpressPei's Passthru CQ This applies the volatile keyword and appropriate casts to the NvmExpressPei's Passthru CQ. Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Oliver Smith-Denny Reviewed-by: Hao A Wu Acked-by: Michael Kubacki --- MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c index 5081b53cd5..ac9328047f 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c @@ -115,7 +115,7 @@ NvmeCreatePrpList ( **/ EFI_STATUS NvmeCheckCqStatus ( - IN NVME_CQ *Cq + IN volatile NVME_CQ *Cq ) { if ((Cq->Sct == 0x0) && (Cq->Sc == 0x0)) { @@ -344,7 +344,7 @@ NvmePassThruExecute ( { EFI_STATUS Status; NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_CQ *Cq; UINT8 QueueId; UINTN SqSize; UINTN CqSize; @@ -617,7 +617,7 @@ NvmePassThruExecute ( // // Copy the Respose Queue entry for this command to the callers response buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION)); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION)); // // Check the NVMe cmd execution result -- cgit v1.2.3