[NTOSKRNL]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 24 Nov 2012 19:50:31 +0000 (19:50 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 24 Nov 2012 19:50:31 +0000 (19:50 +0000)
Code formatting only

svn path=/trunk/; revision=57763

reactos/ntoskrnl/inbv/inbvport.c

index 839d6fe..5f58cff 100644 (file)
 
 CPPORT Port[4] =
 {
-       {NULL, 0, TRUE},
-       {NULL, 0, TRUE},
-       {NULL, 0, TRUE},
-       {NULL, 0, TRUE}
+    {NULL, 0, TRUE},
+    {NULL, 0, TRUE},
+    {NULL, 0, TRUE},
+    {NULL, 0, TRUE}
 };
 
 /* FUNCTIONS *****************************************************************/
 
 VOID
 NTAPI
-InbvPortEnableFifo(
-       IN ULONG PortId,
-       IN BOOLEAN Enable
-       )
+InbvPortEnableFifo(IN ULONG   PortId,
+                   IN BOOLEAN Enable)
 {
-       /* Set FIFO as requested */
-       CpEnableFifo(Port[PortId].Address, Enable);
+    /* Set FIFO as requested */
+    CpEnableFifo(Port[PortId].Address, Enable);
 }
 
 VOID
 NTAPI
-InbvPortPutByte(
-       IN ULONG PortId,
-       IN BOOLEAN Output
-       )
+InbvPortPutByte(IN ULONG   PortId,
+                IN BOOLEAN Output)
 {
-       /* Send the byte */
-       CpPutByte(&Port[PortId], Output);
+    /* Send the byte */
+    CpPutByte(&Port[PortId], Output);
 }
 
 VOID
 NTAPI
-InbvPortTerminate(
-       IN ULONG PortId
-       )
+InbvPortTerminate(IN ULONG PortId)
 {
-       /* The port is now available */
-       Port[PortId].Address = NULL;
+    /* The port is now available */
+    Port[PortId].Address = NULL;
 }
 
 BOOLEAN
 NTAPI
-InbvPortInitialize(
-       IN ULONG BaudRate,
-       IN ULONG PortNumber,
-       IN PUCHAR PortAddress,
-       OUT PULONG PortId,
-       IN BOOLEAN IsMMIODevice
-       )
+InbvPortInitialize(IN  ULONG   BaudRate,
+                   IN  ULONG   PortNumber,
+                   IN  PUCHAR  PortAddress,
+                   OUT PULONG  PortId,
+                   IN  BOOLEAN IsMMIODevice)
 {
-       /* Not yet supported */
-       ASSERT(IsMMIODevice == FALSE);
+    /* Not yet supported */
+    ASSERT(IsMMIODevice == FALSE);
 
-       /* Set default baud rate */
+    /* Set default baud rate */
     if (BaudRate == 0) BaudRate = 19200;
 
-       /* Check if port or address given */
-       if (PortNumber)
-       {
-               /* Pick correct address for port */
-          if (!PortAddress)
-               {
+    /* Check if port or address given */
+    if (PortNumber)
+    {
+        /* Pick correct address for port */
+        if (!PortAddress)
+        {
             switch (PortNumber)
-                       {
-                               case 1:
-                                       PortAddress = (PUCHAR)0x3F8;
-                                       break;
-
-                               case 2:
-                                       PortAddress = (PUCHAR)0x2F8;
-                                       break;
-
-                               case 3:
-                                       PortAddress = (PUCHAR)0x3E8;
-                                       break;
-
-                               default:
-                                       PortNumber = 4;
-                                       PortAddress = (PUCHAR)0x2E8;
-                       }
-               }
+            {
+                case 1:
+                    PortAddress = (PUCHAR)0x3F8;
+                    break;
+
+                case 2:
+                    PortAddress = (PUCHAR)0x2F8;
+                    break;
+
+                case 3:
+                    PortAddress = (PUCHAR)0x3E8;
+                    break;
+
+                default:
+                    PortNumber = 4;
+                    PortAddress = (PUCHAR)0x2E8;
+            }
+        }
     }
-       else
-       {
-               /* Pick correct port for address */
-               PortAddress = (PUCHAR)0x2F8;
-               if (CpDoesPortExist(PortAddress))
-               {
-                       PortNumber = 2;
+    else
+    {
+        /* Pick correct port for address */
+        PortAddress = (PUCHAR)0x2F8;
+        if (CpDoesPortExist(PortAddress))
+        {
+            PortNumber = 2;
+        }
+        else
+        {
+            PortAddress = (PUCHAR)0x3F8;
+            if (!CpDoesPortExist(PortAddress)) return FALSE;
+            PortNumber = 1;
         }
-               else
-               {
-                       PortAddress = (PUCHAR)0x3F8;
-                       if (!CpDoesPortExist(PortAddress)) return FALSE;
-                       PortNumber = 1;
-               }
-       }
-
-       /* Initialize the port unless it's already up, and then return it */
-       if (Port[PortNumber - 1].Address) return FALSE;
-       CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate);
-       *PortId = PortNumber - 1;
-       return TRUE;
+    }
+
+    /* Initialize the port unless it's already up, and then return it */
+    if (Port[PortNumber - 1].Address) return FALSE;
+
+    CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate);
+    *PortId = PortNumber - 1;
+
+    return TRUE;
 }
+
+/* EOF */