]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/AtapiPassThruDxe/AtapiPassThru.c
IntelSiliconPkg IntelVTdDxe: use gEfiAcpi10TableGuid for ACPI 1.0
[mirror_edk2.git] / OptionRomPkg / AtapiPassThruDxe / AtapiPassThru.c
index 43b18113d255ed236c0a931eaa2ade274cd03789..e6e2b36809d009ca24a424f296c04e7cf3bb2b33 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   http://opensource.org/licenses/bsd-license.php\r
@@ -300,7 +300,7 @@ AtapiScsiPassThruDriverBindingStop (
 \r
 Routine Description:\r
 \r
-  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  Stop this driver on ControllerHandle. Support stopping any child handles\r
   created by this driver.\r
 \r
 Arguments:\r
@@ -1749,10 +1749,12 @@ Returns:
 {\r
   UINT8 Index;\r
   UINT8 *OpCode;\r
+  UINT8 ArrayLen;\r
 \r
   OpCode = (UINT8 *) (Packet->Cdb);\r
+  ArrayLen = (UINT8) (ARRAY_SIZE (gSupportedATAPICommands));\r
 \r
-  for (Index = 0; CompareMem (&gSupportedATAPICommands[Index], &gEndTable, sizeof (SCSI_COMMAND_SET)); Index++) {\r
+  for (Index = 0; (Index < ArrayLen) && (CompareMem (&gSupportedATAPICommands[Index], &gEndTable, sizeof (SCSI_COMMAND_SET)) != 0); Index++) {\r
 \r
     if (*OpCode == gSupportedATAPICommands[Index].OpCode) {\r
       //\r
@@ -1883,11 +1885,11 @@ RequestSenseCommand (
 \r
 Routine Description:\r
 \r
-  Sumbit request sense command\r
+  Submit request sense command\r
 \r
 Arguments:\r
 \r
-  AtapiScsiPrivate  - The pionter of ATAPI_SCSI_PASS_THRU_DEV\r
+  AtapiScsiPrivate  - The pointer of ATAPI_SCSI_PASS_THRU_DEV\r
   Target            - The target ID\r
   Timeout           - The time to complete the command\r
   SenseData         - The buffer to fill in sense data\r
@@ -1990,10 +1992,12 @@ Returns:
 {\r
   UINT8 Index;\r
   UINT8 *OpCode;\r
+  UINT8 ArrayLen;\r
 \r
   OpCode = (UINT8 *) (Packet->Cdb);\r
+  ArrayLen = (UINT8) (ARRAY_SIZE (gSupportedATAPICommands));\r
 \r
-  for (Index = 0; CompareMem (&gSupportedATAPICommands[Index], &gEndTable, sizeof (SCSI_COMMAND_SET)); Index++) {\r
+  for (Index = 0; (Index < ArrayLen) && (CompareMem (&gSupportedATAPICommands[Index], &gEndTable, sizeof (SCSI_COMMAND_SET)) != 0); Index++) {\r
 \r
     if (*OpCode == gSupportedATAPICommands[Index].OpCode) {\r
       //\r