]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / DriverSample.c
index af31615a61b612a1d4e080d6b049250167fbb7ad..36ed734e382e0beef64945017c21c19cfd62ff09 100644 (file)
@@ -2,7 +2,7 @@
 This is an example of how a driver might export data to the HII protocol to be\r
 later utilized by the Setup Protocol\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
@@ -127,12 +127,12 @@ NotificationFunction(
   )\r
 {\r
   gBS->SignalEvent (mEvent);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
-  Function to start monitoring for CTRL-C using SimpleTextInputEx. \r
+  Function to start monitoring for CTRL-C using SimpleTextInputEx.\r
 \r
   @retval EFI_SUCCESS           The feature is enabled.\r
   @retval EFI_OUT_OF_RESOURCES  There is not enough mnemory available.\r
@@ -175,7 +175,7 @@ InternalStartMonitor(
     if (EFI_ERROR (Status)) {\r
       break;\r
     }\r
-    \r
+\r
     KeyData.KeyState.KeyShiftState  = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;\r
     Status = SimpleEx->RegisterKeyNotify(\r
       SimpleEx,\r
@@ -191,7 +191,7 @@ InternalStartMonitor(
 }\r
 \r
 /**\r
-  Function to stop monitoring for CTRL-C using SimpleTextInputEx.  \r
+  Function to stop monitoring for CTRL-C using SimpleTextInputEx.\r
 \r
   @retval EFI_SUCCESS           The feature is enabled.\r
   @retval EFI_OUT_OF_RESOURCES  There is not enough mnemory available.\r
@@ -205,7 +205,7 @@ InternalStopMonitor(
   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx;\r
   EFI_STATUS                        Status;\r
   EFI_HANDLE                        *Handles;\r
-  EFI_KEY_DATA                      KeyData;  \r
+  EFI_KEY_DATA                      KeyData;\r
   UINTN                             HandleCount;\r
   UINTN                             HandleIndex;\r
   EFI_HANDLE                        NotifyHandle;\r
@@ -344,7 +344,7 @@ GetValueOfNumber (
     Status = EFI_OUT_OF_RESOURCES;\r
     goto Exit;\r
   }\r
-  \r
+\r
   Length = *Len;\r
   ZeroMem (TemStr, sizeof (TemStr));\r
   for (Index = 0; Index < Length; Index ++) {\r
@@ -369,7 +369,7 @@ Exit:
 }\r
 \r
 /**\r
-  Create altcfg string. \r
+  Create altcfg string.\r
 \r
   @param  Result               The request result string.\r
   @param  ConfigHdr            The request head info. <ConfigHdr> format.\r
@@ -379,7 +379,7 @@ Exit:
 \r
   @retval  The string with altcfg info append at the end.\r
 **/\r
-EFI_STRING \r
+EFI_STRING\r
 CreateAltCfgString (\r
   IN     EFI_STRING     Result,\r
   IN     EFI_STRING     ConfigHdr,\r
@@ -404,60 +404,60 @@ CreateAltCfgString (
   TmpStr = StringPtr;\r
   if (Result != NULL) {\r
     StrCpyS (StringPtr, NewLen / sizeof (CHAR16), Result);\r
-    StringPtr += StrLen (Result);  \r
+    StringPtr += StrLen (Result);\r
     FreePool (Result);\r
   }\r
-  \r
+\r
   UnicodeSPrint (\r
-  StringPtr, \r
-  (1 + StrLen (ConfigHdr) + 8 + 4 + 1) * sizeof (CHAR16), \r
-  L"&%s&ALTCFG=%04x", \r
-  ConfigHdr, \r
+  StringPtr,\r
+  (1 + StrLen (ConfigHdr) + 8 + 4 + 1) * sizeof (CHAR16),\r
+  L"&%s&ALTCFG=%04x",\r
+  ConfigHdr,\r
   EFI_HII_DEFAULT_CLASS_STANDARD\r
   );\r
   StringPtr += StrLen (StringPtr);\r
 \r
   UnicodeSPrint (\r
-    StringPtr, \r
+    StringPtr,\r
     (8 + 4 + 7 + 4 + 7 + 4 + 1) * sizeof (CHAR16),\r
-    L"&OFFSET=%04x&WIDTH=%04x&VALUE=%04x", \r
-    Offset, \r
+    L"&OFFSET=%04x&WIDTH=%04x&VALUE=%04x",\r
+    Offset,\r
     Width,\r
     DEFAULT_CLASS_STANDARD_VALUE\r
     );\r
-  StringPtr += StrLen (StringPtr);  \r
+  StringPtr += StrLen (StringPtr);\r
 \r
   UnicodeSPrint (\r
-  StringPtr, \r
-  (1 + StrLen (ConfigHdr) + 8 + 4 + 1) * sizeof (CHAR16), \r
-  L"&%s&ALTCFG=%04x", \r
-  ConfigHdr, \r
+  StringPtr,\r
+  (1 + StrLen (ConfigHdr) + 8 + 4 + 1) * sizeof (CHAR16),\r
+  L"&%s&ALTCFG=%04x",\r
+  ConfigHdr,\r
   EFI_HII_DEFAULT_CLASS_MANUFACTURING\r
   );\r
   StringPtr += StrLen (StringPtr);\r
 \r
   UnicodeSPrint (\r
-    StringPtr, \r
+    StringPtr,\r
     (8 + 4 + 7 + 4 + 7 + 4 + 1) * sizeof (CHAR16),\r
-    L"&OFFSET=%04x&WIDTH=%04x&VALUE=%04x", \r
-    Offset, \r
+    L"&OFFSET=%04x&WIDTH=%04x&VALUE=%04x",\r
+    Offset,\r
     Width,\r
     DEFAULT_CLASS_MANUFACTURING_VALUE\r
     );\r
-  StringPtr += StrLen (StringPtr); \r
+  StringPtr += StrLen (StringPtr);\r
 \r
   return TmpStr;\r
 }\r
 \r
 /**\r
-  Check whether need to add the altcfg string. if need to add, add the altcfg \r
+  Check whether need to add the altcfg string. if need to add, add the altcfg\r
   string.\r
 \r
   @param  RequestResult              The request result string.\r
   @param  ConfigRequestHdr           The request head info. <ConfigHdr> format.\r
 \r
 **/\r
-VOID \r
+VOID\r
 AppendAltCfgString (\r
   IN OUT EFI_STRING                       *RequestResult,\r
   IN     EFI_STRING                       ConfigRequestHdr\r
@@ -791,7 +791,7 @@ ExtractConfig (
         Value += StrnLenS (Value, (BufferSize - ((UINTN)Value - (UINTN)*Results)) / sizeof (CHAR16));\r
       }\r
     }\r
-    \r
+\r
     Status = EFI_SUCCESS;\r
   } else {\r
     //\r
@@ -1209,7 +1209,7 @@ DriverCallback (
       }\r
     }\r
     break;\r
-    \r
+\r
   case EFI_BROWSER_ACTION_RETRIEVE:\r
     {\r
       switch (QuestionId ) {\r
@@ -1255,7 +1255,7 @@ DriverCallback (
           EFI_IFR_FLAG_CALLBACK,            // Question flag\r
           0                                 // Action String ID\r
         );\r
-      \r
+\r
         HiiUpdateForm (\r
           PrivateData->HiiHandle[0],        // HII handle\r
           &gDriverSampleFormSetGuid,        // Formset GUID\r
@@ -1336,7 +1336,7 @@ DriverCallback (
         break;\r
 \r
       default:\r
-        Status = EFI_UNSUPPORTED;      \r
+        Status = EFI_UNSUPPORTED;\r
       break;\r
       }\r
     }\r
@@ -1537,14 +1537,14 @@ DriverCallback (
         //\r
         *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
         break;\r
-      \r
+\r
       case 0x1238:\r
         //\r
         // User press "Save now", request Browser to save the uncommitted data.\r
         //\r
         *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
         break;\r
-      \r
+\r
       case 0x1241:\r
       case 0x1246:\r
         //\r
@@ -1552,21 +1552,21 @@ DriverCallback (
         //\r
         *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
         break;\r
-      \r
+\r
       case 0x1242:\r
         //\r
         // User press "Discard current form now", request Browser to discard the uncommitted data.\r
         //\r
         *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;\r
         break;\r
-      \r
+\r
       case 0x1243:\r
         //\r
         // User press "Submit current form now", request Browser to save the uncommitted data.\r
         //\r
         *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
         break;\r
-      \r
+\r
       case 0x1244:\r
       case 0x1245:\r
         //\r
@@ -1606,7 +1606,7 @@ DriverCallback (
         //\r
         // 2. If system support this keyword, just try to change value.\r
         //\r
-        \r
+\r
         //\r
         // Change value from '0' to '1' or from '1' to '0'\r
         //\r
@@ -2114,7 +2114,7 @@ DriverSampleInit (
   FreePool (ConfigRequestHdr);\r
 \r
   Status = gBS->CreateEventEx (\r
-        EVT_NOTIFY_SIGNAL, \r
+        EVT_NOTIFY_SIGNAL,\r
         TPL_NOTIFY,\r
         EfiEventEmptyFunction,\r
         NULL,\r
@@ -2125,7 +2125,7 @@ DriverSampleInit (
 \r
   //\r
   // Example of how to use BrowserEx protocol to register HotKey.\r
-  // \r
+  //\r
   Status = gBS->LocateProtocol (&gEdkiiFormBrowserExProtocolGuid, NULL, (VOID **) &FormBrowserEx);\r
   if (!EFI_ERROR (Status)) {\r
     //\r
@@ -2136,7 +2136,7 @@ DriverSampleInit (
     FormBrowserEx->RegisterHotKey (&HotKey, 0, 0, NULL);\r
     HotKey.ScanCode    = SCAN_F10;\r
     FormBrowserEx->RegisterHotKey (&HotKey, 0, 0, NULL);\r
-    \r
+\r
     //\r
     // Register the default HotKey F9 and F10 again.\r
     //\r