]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeSmbusLib/SmbusLib.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / DxeSmbusLib / SmbusLib.c
index fe1a0944dc0ebab67f76ca484eaad6015460515f..effe3a41b9a2885e5e7565be8729e51b006aecd4 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 Implementation of SmBusLib class library for DXE phase.\r
 \r
-Copyright (c) 2006 - 2010, 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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 \r
 **/\r
@@ -31,21 +25,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS:  The SMBUS command was executed.\r
-                        RETURN_TIMEOUT:  A timeout occurred while executing the \r
-                        SMBUS command. \r
-                        RETURN_DEVICE_ERROR: The request was not \r
-                        completed because a failure reflected in the Host Status \r
-                        Register bit.  Device errors are a result of a transaction \r
-                        collision, illegal command field, unclaimed cycle (host \r
-                        initiated), or bus errors (collisions). \r
+                        RETURN_TIMEOUT:  A timeout occurred while executing the\r
+                        SMBUS command.\r
+                        RETURN_DEVICE_ERROR: The request was not\r
+                        completed because a failure reflected in the Host Status\r
+                        Register bit.  Device errors are a result of a transaction\r
+                        collision, illegal command field, unclaimed cycle (host\r
+                        initiated), or bus errors (collisions).\r
                         RETURN_UNSUPPORTED: The SMBus operation is not supported.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 SmBusQuickRead (\r
-  IN  UINTN                     SmBusAddress,\r
-  OUT RETURN_STATUS             *Status       OPTIONAL\r
+  IN  UINTN          SmBusAddress,\r
+  OUT RETURN_STATUS  *Status       OPTIONAL\r
   )\r
 {\r
   ASSERT (!SMBUS_LIB_PEC (SmBusAddress));\r
@@ -72,12 +66,12 @@ SmBusQuickRead (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  \r
-                        Device errors are a result of a transaction collision, \r
-                        illegal command field, unclaimed cycle (host initiated), \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.\r
+                        Device errors are a result of a transaction collision,\r
+                        illegal command field, unclaimed cycle (host initiated),\r
                         or bus errors (collisions).\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -85,8 +79,8 @@ SmBusQuickRead (
 VOID\r
 EFIAPI\r
 SmBusQuickWrite (\r
-  IN  UINTN                     SmBusAddress,\r
-  OUT RETURN_STATUS             *Status       OPTIONAL\r
+  IN  UINTN          SmBusAddress,\r
+  OUT RETURN_STATUS  *Status       OPTIONAL\r
   )\r
 {\r
   ASSERT (!SMBUS_LIB_PEC (SmBusAddress));\r
@@ -113,12 +107,12 @@ SmBusQuickWrite (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
                         a failure reflected in the Host Status Register bit.  Device\r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle(host initiated), or bus \r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle(host initiated), or bus\r
                         errors (collisions).\r
                         RETURN_CRC_ERROR:  The checksum is not correct. (PEC is incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
@@ -133,7 +127,7 @@ SmBusReceiveByte (
   OUT RETURN_STATUS  *Status        OPTIONAL\r
   )\r
 {\r
-  UINT8   Byte;\r
+  UINT8  Byte;\r
 \r
   ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);\r
   ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)  == 0);\r
@@ -161,12 +155,12 @@ SmBusReceiveByte (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
                         RETURN_DEVICE_ERROR:  The request was not completed because\r
-                        a failure reflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle(host initiated), or bus \r
+                        a failure reflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle(host initiated), or bus\r
                         errors (collisions).\r
                         RETURN_CRC_ERROR:  The checksum is not correct (PEC is incorrect)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
@@ -182,13 +176,13 @@ SmBusSendByte (
   OUT RETURN_STATUS  *Status        OPTIONAL\r
   )\r
 {\r
-  UINT8   Byte;\r
+  UINT8  Byte;\r
 \r
   ASSERT (SMBUS_LIB_COMMAND (SmBusAddress)   == 0);\r
   ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
   ASSERT (SMBUS_LIB_RESERVED (SmBusAddress) == 0);\r
 \r
-  Byte   = Value;\r
+  Byte = Value;\r
   InternalSmBusExec (EfiSmbusSendByte, SmBusAddress, 1, &Byte, Status);\r
 \r
   return Value;\r
@@ -209,12 +203,12 @@ SmBusSendByte (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failurereflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle (host initiated), or bus \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failurereflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle (host initiated), or bus\r
                         errors (collisions).\r
                         RETURN_CRC_ERROR:  The checksum is not correct (PEC is incorrect)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
@@ -229,7 +223,7 @@ SmBusReadDataByte (
   OUT RETURN_STATUS  *Status        OPTIONAL\r
   )\r
 {\r
-  UINT8   Byte;\r
+  UINT8  Byte;\r
 \r
   ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
   ASSERT (SMBUS_LIB_RESERVED (SmBusAddress) == 0);\r
@@ -256,12 +250,12 @@ SmBusReadDataByte (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle host initiated), or bus \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle host initiated), or bus\r
                         errors (collisions).\r
                         RETURN_CRC_ERROR:  The checksum is not correct. (PEC is incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
@@ -277,7 +271,7 @@ SmBusWriteDataByte (
   OUT RETURN_STATUS  *Status        OPTIONAL\r
   )\r
 {\r
-  UINT8   Byte;\r
+  UINT8  Byte;\r
 \r
   ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
   ASSERT (SMBUS_LIB_RESERVED (SmBusAddress) == 0);\r
@@ -297,20 +291,20 @@ SmBusWriteDataByte (
   If Status is not NULL, then the status of the executed command is returned in Status.\r
   If Length in SmBusAddress is not zero, then ASSERT().\r
   If any reserved bits of SmBusAddress are set, then ASSERT().\r
-  \r
+\r
   @param  SmBusAddress  The address that encodes the SMBUS Slave Address,\r
                         SMBUS Command, SMBUS Data Length, and PEC.\r
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  \r
-                        Device errors are a result of a transaction collision, \r
-                        illegal command field, unclaimed cycle (host initiated), \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.\r
+                        Device errors are a result of a transaction collision,\r
+                        illegal command field, unclaimed cycle (host initiated),\r
                         or bus errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is \r
+                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is\r
                         incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -351,14 +345,14 @@ SmBusReadDataWord (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the SMBUS \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the SMBUS\r
                         command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  \r
-                        Device errors are a result of a transaction collision, \r
-                        illegal command field, unclaimed cycle (host initiated), \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.\r
+                        Device errors are a result of a transaction collision,\r
+                        illegal command field, unclaimed cycle (host initiated),\r
                         or bus errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. \r
+                        RETURN_CRC_ERROR:  The checksum is not correct.\r
                         (PEC is incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -401,14 +395,14 @@ SmBusWriteDataWord (
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  \r
-                        Device errors are a result of a transaction collision, \r
-                        illegal command field, unclaimed cycle (host initiated), \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.\r
+                        Device errors are a result of a transaction collision,\r
+                        illegal command field, unclaimed cycle (host initiated),\r
                         or bus errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is \r
+                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is\r
                         incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -447,19 +441,19 @@ SmBusProcessCall (
 \r
   @param  SmBusAddress  The address that encodes the SMBUS Slave Address,\r
                         SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Buffer        The pointer to the buffer to store the bytes read from \r
+  @param  Buffer        The pointer to the buffer to store the bytes read from\r
                         the SMBUS.\r
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
                         RETURN_SUCCESS: The SMBUS command was executed.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the SMBUS \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the SMBUS\r
                         command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle (host initiated), or bus \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle (host initiated), or bus\r
                         errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is \r
+                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is\r
                         incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -488,25 +482,25 @@ SmBusReadBlock (
   The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r
   Bytes are written to the SMBUS from Buffer.\r
   The number of bytes written is returned, and will never return a value larger than 32-bytes.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.  \r
+  If Status is not NULL, then the status of the executed command is returned in Status.\r
   If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r
   If Buffer is NULL, then ASSERT().\r
   If any reserved bits of SmBusAddress are set, then ASSERT().\r
 \r
   @param  SmBusAddress  The address that encodes the SMBUS Slave Address,\r
                         MBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Buffer        The pointer to the buffer to store the bytes read from \r
+  @param  Buffer        The pointer to the buffer to store the bytes read from\r
                         the SMBUS.\r
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR:  The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle (host initiated), or bus \r
+                        RETURN_DEVICE_ERROR:  The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle (host initiated), or bus\r
                         errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is \r
+                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is\r
                         incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -552,14 +546,14 @@ SmBusWriteBlock (
   @param  ReadBuffer    The pointer to the buffer of bytes to read from the SMBUS.\r
   @param  Status        Return status for the executed command.\r
                         This is an optional parameter and may be NULL.\r
-                        RETURN_TIMEOUT: A timeout occurred while executing the \r
+                        RETURN_TIMEOUT: A timeout occurred while executing the\r
                         SMBUS command.\r
-                        RETURN_DEVICE_ERROR: The request was not completed because \r
-                        a failure reflected in the Host Status Register bit.  Device \r
-                        errors are a result of a transaction collision, illegal \r
-                        command field, unclaimed cycle (host initiated), or bus \r
+                        RETURN_DEVICE_ERROR: The request was not completed because\r
+                        a failure reflected in the Host Status Register bit.  Device\r
+                        errors are a result of a transaction collision, illegal\r
+                        command field, unclaimed cycle (host initiated), or bus\r
                         errors (collisions).\r
-                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is \r
+                        RETURN_CRC_ERROR:  The checksum is not correct. (PEC is\r
                         incorrect.)\r
                         RETURN_UNSUPPORTED:  The SMBus operation is not supported.\r
 \r
@@ -575,7 +569,7 @@ SmBusBlockProcessCall (
   OUT RETURN_STATUS  *Status        OPTIONAL\r
   )\r
 {\r
-  UINTN   Length;\r
+  UINTN  Length;\r
 \r
   ASSERT (WriteBuffer != NULL);\r
   ASSERT (ReadBuffer  != NULL);\r