]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Check Library usage and fix some typo.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Dec 2008 09:18:12 +0000 (09:18 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Dec 2008 09:18:12 +0000 (09:18 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7140 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c

index d889b974d6d8e221c26f02ff69086ff4f806bd60..1ccc8784d028960f9ca1d0388dbc3b62a0281f84 100644 (file)
@@ -545,6 +545,7 @@ USBKeyboardReadKeyStrokeWorker (
   EFI_STATUS                        Status;\r
   UINT8                             KeyCode;  \r
   LIST_ENTRY                        *Link;\r
+  LIST_ENTRY                        *NotifyList;\r
   KEYBOARD_CONSOLE_IN_EX_NOTIFY     *CurrentNotify;  \r
   EFI_KEY_DATA                      OriginalKeyData;\r
 \r
@@ -609,9 +610,10 @@ USBKeyboardReadKeyStrokeWorker (
   //\r
   // Invoke notification functions if the key is registered.\r
   //\r
-  for (Link = GetFirstNode (&UsbKeyboardDevice->NotifyList);\r
-       !IsNull (&UsbKeyboardDevice->NotifyList, Link);\r
-       Link = GetNextNode (&UsbKeyboardDevice->NotifyList, Link)) {\r
+  NotifyList = &UsbKeyboardDevice->NotifyList;\r
+  for (Link = GetFirstNode (NotifyList);\r
+       !IsNull (NotifyList, Link);\r
+       Link = GetNextNode (NotifyList, Link)) {\r
     CurrentNotify = CR (Link, KEYBOARD_CONSOLE_IN_EX_NOTIFY, NotifyEntry, USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE);\r
     if (IsKeyRegistered (&CurrentNotify->KeyData, &OriginalKeyData)) { \r
       CurrentNotify->KeyNotificationFn (&OriginalKeyData);\r
@@ -622,7 +624,7 @@ USBKeyboardReadKeyStrokeWorker (
 }\r
 \r
 /**\r
-  Reset the input device and optionaly run diagnostics\r
+  Reset the input device and optionally run diagnostics\r
 \r
   There are 2 types of reset for USB keyboard.\r
   For non-exhaustive reset, only keyboard buffer is cleared.\r
@@ -695,7 +697,7 @@ USBKeyboardReset (
 \r
   @retval EFI_SUCCESS          The keystroke information was returned.\r
   @retval EFI_NOT_READY        There was no keystroke data availiable.\r
-  @retval EFI_DEVICE_ERROR     The keydtroke information was not returned due to\r
+  @retval EFI_DEVICE_ERROR     The keystroke information was not returned due to\r
                                hardware errors.\r
 \r
 **/\r
@@ -826,7 +828,7 @@ KbdFreeNotifyList (
   @param  InputData         A pointer to keystroke data for the key that was pressed.\r
 \r
   @retval TRUE              Key pressed matches a registered key.\r
-  @retval FLASE             Key pressed does not matche a registered key.\r
+  @retval FLASE             Key pressed does not matches a registered key.\r
 \r
 **/\r
 BOOLEAN\r
@@ -1015,7 +1017,7 @@ USBKeyboardSetState (
   @param  NotifyHandle                Points to the unique handle assigned to the registered notification.\r
 \r
   @retval EFI_SUCCESS                 The notification function was registered successfully.\r
-  @retval EFI_OUT_OF_RESOURCES        Unable to allocate resources for necesssary data structures.\r
+  @retval EFI_OUT_OF_RESOURCES        Unable to allocate resources for necessary data structures.\r
   @retval EFI_INVALID_PARAMETER       KeyData or NotifyHandle or KeyNotificationFunction is NULL.\r
 \r
 **/\r
@@ -1032,6 +1034,7 @@ USBKeyboardRegisterKeyNotify (
   EFI_STATUS                        Status;\r
   KEYBOARD_CONSOLE_IN_EX_NOTIFY     *NewNotify;\r
   LIST_ENTRY                        *Link;\r
+  LIST_ENTRY                        *NotifyList;\r
   KEYBOARD_CONSOLE_IN_EX_NOTIFY     *CurrentNotify;  \r
 \r
   if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {\r
@@ -1043,9 +1046,11 @@ USBKeyboardRegisterKeyNotify (
   //\r
   // Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.\r
   //\r
-  for (Link = GetFirstNode (&UsbKeyboardDevice->NotifyList);\r
-       !IsNull (&UsbKeyboardDevice->NotifyList, Link);\r
-       Link = GetNextNode (&UsbKeyboardDevice->NotifyList, Link)) {\r
+  NotifyList = &UsbKeyboardDevice->NotifyList;\r
+  \r
+  for (Link = GetFirstNode (NotifyList);\r
+       !IsNull (NotifyList, Link);\r
+       Link = GetNextNode (NotifyList, Link)) {\r
     CurrentNotify = CR (\r
                       Link, \r
                       KEYBOARD_CONSOLE_IN_EX_NOTIFY, \r
@@ -1112,6 +1117,7 @@ USBKeyboardUnregisterKeyNotify (
   EFI_STATUS                        Status;\r
   KEYBOARD_CONSOLE_IN_EX_NOTIFY     *CurrentNotify;\r
   LIST_ENTRY                        *Link;\r
+  LIST_ENTRY                        *NotifyList;\r
 \r
   if (NotificationHandle == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -1137,9 +1143,10 @@ USBKeyboardUnregisterKeyNotify (
   //\r
   // Traverse notify list of USB keyboard and remove the entry of NotificationHandle.\r
   //\r
-  for (Link = GetFirstNode (&UsbKeyboardDevice->NotifyList);\r
-       !IsNull (&UsbKeyboardDevice->NotifyList, Link);\r
-       Link = GetNextNode (&UsbKeyboardDevice->NotifyList, Link)) {\r
+  NotifyList = &UsbKeyboardDevice->NotifyList;\r
+  for (Link = GetFirstNode (NotifyList);\r
+       !IsNull (NotifyList, Link);\r
+       Link = GetNextNode (NotifyList, Link)) {\r
     CurrentNotify = CR (\r
                       Link, \r
                       KEYBOARD_CONSOLE_IN_EX_NOTIFY, \r
index 3acdd76187869575adbf2f4f33a4be97e950ca9e..79598c5a01dc002b95d15299d824b637ad75e73e 100644 (file)
@@ -477,17 +477,19 @@ FindUsbNsKey (
   )\r
 {\r
   LIST_ENTRY      *Link;\r
+  LIST_ENTRY      *NsKeyList;\r
   USB_NS_KEY      *UsbNsKey;\r
-\r
-  Link = GetFirstNode (&UsbKeyboardDevice->NsKeyList);\r
-  while (!IsNull (&UsbKeyboardDevice->NsKeyList, Link)) {\r
+  \r
+  NsKeyList = &UsbKeyboardDevice->NsKeyList;\r
+  Link = GetFirstNode (NsKeyList);\r
+  while (!IsNull (NsKeyList, Link)) {\r
     UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link);\r
 \r
     if (UsbNsKey->NsKey[0].Key == KeyDescriptor->Key) {\r
       return UsbNsKey;\r
     }\r
 \r
-    Link = GetNextNode (&UsbKeyboardDevice->NsKeyList, Link);\r
+    Link = GetNextNode (NsKeyList, Link);\r
   }\r
 \r
   return NULL;\r
@@ -644,7 +646,7 @@ SetKeyboardLayoutEvent (
   KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, 0x28);\r
   CopyMem (TableEntry, KeyDescriptor, sizeof (EFI_KEY_DESCRIPTOR));\r
 \r
-  gBS->FreePool (KeyboardLayout);\r
+  FreePool (KeyboardLayout);\r
 }\r
 \r
 /**\r
@@ -1921,7 +1923,7 @@ USBKeyboardRepeatHandler (
       );\r
 \r
     //\r
-    // Set repeate rate for next repeat key generation.\r
+    // Set repeat rate for next repeat key generation.\r
     //\r
     gBS->SetTimer (\r
            UsbKeyboardDevice->RepeatTimer,\r