From 293b97d0c4624c13a4e934294d2c4b161a09a91b Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 28 Apr 2023 01:36:21 +0800 Subject: Add the volatile keyword to NvmExpressDxe's Passthru CQ This updates the relevant functions that expect a non-volatile structure to be passed to them to take casts of the CQ now that it is volatile. 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/NvmExpressDxe/NvmExpressPassthru.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index f37baa6..2ff2cb0 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -460,7 +460,7 @@ NvmExpressPassThru ( EFI_STATUS PreviousStatus; EFI_PCI_IO_PROTOCOL *PciIo; NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_CQ *Cq; UINT16 QueueId; UINT16 QueueSize; UINT32 Bytes; @@ -815,14 +815,14 @@ NvmExpressPassThru ( // Dump every completion entry status for debugging. // DEBUG_CODE_BEGIN (); - NvmeDumpStatus (Cq); + NvmeDumpStatus ((NVME_CQ *)Cq); DEBUG_CODE_END (); } // // 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)); } else { // // Timeout occurs for an NVMe command. Reset the controller to abort the -- cgit v1.1