add .clang-format

Add .clang-format for automatic style.

Change-Id: I91e9acb28ca4218eba58dc13d10773bcb39c338f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..ea71ad6
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,99 @@
+---
+Language:        Cpp
+# BasedOnStyle:  LLVM
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: false
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      true
+  AfterControlStatement: true
+  AfterEnum:       true
+  AfterFunction:   true
+  AfterNamespace:  true
+  AfterObjCDeclaration: true
+  AfterStruct:     true
+  AfterUnion:      true
+  BeforeCatch:     true
+  BeforeElse:      true
+  IndentBraces:    false
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: AfterColon
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+PointerAlignment: Left
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeBlocks: Regroup
+IncludeCategories:
+  - Regex:           '^[<"](gtest|gmock)'
+    Priority:        5
+  - Regex:           '^"config.h"'
+    Priority:        -1
+  - Regex:           '^".*\.hpp"'
+    Priority:        1
+  - Regex:           '^<.*\.h>'
+    Priority:        2
+  - Regex:           '^<.*'
+    Priority:        3
+  - Regex:           '.*'
+    Priority:        4
+IndentCaseLabels: true
+IndentWidth:     4
+IndentWrappedFunctionNames: true
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+ReflowComments:  true
+SortIncludes:    true
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Cpp11
+TabWidth:        4
+UseTab:          Never
+...
+
diff --git a/file.hpp b/file.hpp
index 33df65f..7596db1 100644
--- a/file.hpp
+++ b/file.hpp
@@ -1,6 +1,9 @@
 #pragma once
 
 #include <unistd.h>
+
+#include <sstream>
+
 namespace openpower
 {
 namespace sbe
@@ -13,58 +16,57 @@
  */
 class FileDescriptor
 {
-    private:
-        /** @brief File descriptor for the SBE FIFO device */
-        int fd = -1;
+  private:
+    /** @brief File descriptor for the SBE FIFO device */
+    int fd = -1;
 
-    public:
-        FileDescriptor() = delete;
-        FileDescriptor(const FileDescriptor&) = delete;
-        FileDescriptor& operator=(const FileDescriptor&) = delete;
-        FileDescriptor(FileDescriptor&&) = delete;
-        FileDescriptor& operator=(FileDescriptor&&) = delete;
+  public:
+    FileDescriptor() = delete;
+    FileDescriptor(const FileDescriptor&) = delete;
+    FileDescriptor& operator=(const FileDescriptor&) = delete;
+    FileDescriptor(FileDescriptor&&) = delete;
+    FileDescriptor& operator=(FileDescriptor&&) = delete;
 
-        /** @brief Opens the input file and saves the file descriptor
-         *
-         *  @param[in] devPath - Path of the file
-         *  @para,[in] accessModes - File access modes
-         */
-        FileDescriptor(const char* devPath, int accessModes)
+    /** @brief Opens the input file and saves the file descriptor
+     *
+     *  @param[in] devPath - Path of the file
+     *  @para,[in] accessModes - File access modes
+     */
+    FileDescriptor(const char* devPath, int accessModes)
+    {
+        fd = open(devPath, accessModes);
+        if (fd < 0)
         {
-            fd = open(devPath, accessModes);
-            if (fd < 0)
-            {
-                //TODO:use elog infrastructure
-                std::ostringstream errMsg;
-                errMsg << "Opening the device with device path:" <<
-                       devPath << " and access modes:" << accessModes <<
-                       ",Failed with errno" << errno;
-                throw std::runtime_error(errMsg.str().c_str());
-            }
-
+            // TODO:use elog infrastructure
+            std::ostringstream errMsg;
+            errMsg << "Opening the device with device path:" << devPath
+                   << " and access modes:" << accessModes
+                   << ",Failed with errno" << errno;
+            throw std::runtime_error(errMsg.str().c_str());
         }
+    }
 
-        /** @brief Saves File descriptor and uses it to do file operation
-         *
-         *  @param[in] fd - File descriptor
-         */
-        FileDescriptor(int fd) : fd(fd)
+    /** @brief Saves File descriptor and uses it to do file operation
+     *
+     *  @param[in] fd - File descriptor
+     */
+    FileDescriptor(int fd) : fd(fd)
+    {
+        // Nothing
+    }
+
+    ~FileDescriptor()
+    {
+        if (fd >= 0)
         {
-            // Nothing
+            close(fd);
         }
+    }
 
-        ~FileDescriptor()
-        {
-            if (fd >= 0)
-            {
-                close(fd);
-            }
-        }
-
-        int operator()()
-        {
-            return fd;
-        }
+    int operator()()
+    {
+        return fd;
+    }
 };
 
 } // namespace internal
diff --git a/sbe_chipOp_handler.cpp b/sbe_chipOp_handler.cpp
index 361e9f4..dbed874 100644
--- a/sbe_chipOp_handler.cpp
+++ b/sbe_chipOp_handler.cpp
@@ -1,11 +1,12 @@
-#include <array>
+#include <endian.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include <poll.h>
-#include <endian.h>
-#include <sbe_chipOp_handler.hpp>
+#include <unistd.h>
+
+#include <array>
 #include <file.hpp>
+#include <sbe_chipOp_handler.hpp>
 namespace openpower
 {
 namespace sbe
@@ -23,17 +24,16 @@
 constexpr auto MAGIC_CODE_BITS = 16;
 std::vector<sbe_word_t> writeToFifo(const char* devPath,
                                     const sbe_word_t* cmdBuffer,
-                                    size_t cmdBufLen,
-                                    size_t respBufLen)
+                                    size_t cmdBufLen, size_t respBufLen)
 {
     ssize_t len = 0;
     std::vector<sbe_word_t> response;
     std::ostringstream errMsg;
 
-    //Open the device and obtain the file descriptor associated with it.
+    // Open the device and obtain the file descriptor associated with it.
     FileDescriptor fileFd(devPath, (O_RDWR | O_NONBLOCK));
 
-    //Wait for FIFO device and perform write operation
+    // Wait for FIFO device and perform write operation
     struct pollfd poll_fd = {};
     poll_fd.fd = fileFd();
     poll_fd.events = POLLOUT | POLLERR;
@@ -41,145 +41,150 @@
     int rc = 0;
     if ((rc = poll(&poll_fd, 1, -1)) < 0)
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         errMsg << "Waiting for FIFO device:" << devPath << "to write failed"
                << "rc=" << rc << "errno=" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
     if (poll_fd.revents & POLLERR)
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         errMsg << "POLLERR while waiting for writeable FIFO,errno:" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
     auto bytesToWrite = (cmdBufLen * WORD_SIZE);
-    //Perform the write operation
+    // Perform the write operation
     len = write(fileFd(), cmdBuffer, bytesToWrite);
     if (len < 0)
     {
-        //TODO:use elog infrastructure
-        errMsg << "Failed to write to FIFO device:" << devPath << " Length "
-               "returned= " << len << " errno=" << errno;
+        // TODO:use elog infrastructure
+        errMsg << "Failed to write to FIFO device:" << devPath
+               << " Length "
+                  "returned= "
+               << len << " errno=" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
-    //Wait for FIFO device and perform read operation
+    // Wait for FIFO device and perform read operation
     poll_fd.fd = fileFd();
     poll_fd.events = POLLIN | POLLERR;
     if ((rc = poll(&poll_fd, 1, -1) < 0))
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         errMsg << "Waiting for FIFO device:" << devPath << "to read failed"
                << " rc=" << rc << " and errno=" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
     if (poll_fd.revents & POLLERR)
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         errMsg << "POLLERR while waiting for readable FIFO,errno:" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
-    //Derive the total read length which should include the FFDC, which SBE
-    //returns in case of failure.
+    // Derive the total read length which should include the FFDC, which SBE
+    // returns in case of failure.
     size_t totalReadLen = respBufLen + MAX_FFDC_LEN_IN_WORDS;
-    //Create a temporary buffer
+    // Create a temporary buffer
     std::vector<sbe_word_t> buffer(totalReadLen);
 
     ssize_t bytesToRead = (totalReadLen * WORD_SIZE);
     len = read(fileFd(), buffer.data(), bytesToRead);
     if (len < 0)
     {
-        //TODO:use elog infrastructure
-        errMsg << "Failed to read the FIFO device:" << devPath << "bytes read ="
-               << len << " errno=" << errno;
+        // TODO:use elog infrastructure
+        errMsg << "Failed to read the FIFO device:" << devPath
+               << "bytes read =" << len << " errno=" << errno;
         throw std::runtime_error(errMsg.str().c_str());
     }
 
-    //Extract the valid number of words read.
+    // Extract the valid number of words read.
     for (auto i = 0; i < (len / WORD_SIZE); ++i)
     {
         response.push_back(be32toh(buffer[i]));
     }
 
-    //Closing of the file descriptor will be handled when the FileDescriptor
-    //object will go out of scope.
+    // Closing of the file descriptor will be handled when the FileDescriptor
+    // object will go out of scope.
     return response;
 }
 
 void parseResponse(std::vector<sbe_word_t>& sbeDataBuf)
 {
-    //Number of 32-bit words obtained from the SBE
+    // Number of 32-bit words obtained from the SBE
     size_t lengthObtained = sbeDataBuf.size();
 
-    //Fetch the SBE header and SBE chiop primary and secondary status
-    //Last value in the buffer will have the offset for the SBE header
-    size_t distanceToStatusHeader =  sbeDataBuf[sbeDataBuf.size() - 1];
+    // Fetch the SBE header and SBE chiop primary and secondary status
+    // Last value in the buffer will have the offset for the SBE header
+    size_t distanceToStatusHeader = sbeDataBuf[sbeDataBuf.size() - 1];
 
     if (lengthObtained < distanceToStatusHeader)
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         std::ostringstream errMsg;
-        errMsg << "Distance to SBE status header value " <<
-               distanceToStatusHeader << " is greater then total length of "
-               "response buffer " << lengthObtained;
+        errMsg << "Distance to SBE status header value "
+               << distanceToStatusHeader
+               << " is greater then total length of "
+                  "response buffer "
+               << lengthObtained;
         throw std::runtime_error(errMsg.str().c_str());
     }
 
-    //Fetch the response header contents
+    // Fetch the response header contents
     auto iter = sbeDataBuf.begin();
     std::advance(iter, (lengthObtained - distanceToStatusHeader));
 
-    //First header word will have 2 bytes of MAGIC CODE followed by
-    //Command class and command type
+    // First header word will have 2 bytes of MAGIC CODE followed by
+    // Command class and command type
     //|  MAGIC BYTES:0xCODE | COMMAND-CLASS | COMMAND-TYPE|
     sbe_word_t l_magicCode = (*iter >> MAGIC_CODE_BITS);
 
-    //Fetch the primary and secondary response code
+    // Fetch the primary and secondary response code
     std::advance(iter, DISTANCE_TO_RESP_CODE);
     auto l_priSecResp = *iter;
 
-    //Validate the magic code obtained in the response
+    // Validate the magic code obtained in the response
     if (l_magicCode != MAGIC_CODE)
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         std::ostringstream errMsg;
-        errMsg << "Invalid MAGIC keyword in the response header (" <<
-               l_magicCode << "),expected keyword " << MAGIC_CODE;
+        errMsg << "Invalid MAGIC keyword in the response header ("
+               << l_magicCode << "),expected keyword " << MAGIC_CODE;
         throw std::runtime_error(errMsg.str().c_str());
     }
 
-    //Validate the Primary and Secondary response value
+    // Validate the Primary and Secondary response value
     if (l_priSecResp != SBE_OPERATION_SUCCESSFUL)
     {
-        //Extract the SBE FFDC and throw it to the caller
-        size_t ffdcLen = (distanceToStatusHeader -
-                          LENGTH_OF_RESP_HEADER_IN_WORDS -
-                          LENGTH_OF_DISTANCE_HEADER_IN_WORDS);
+        // Extract the SBE FFDC and throw it to the caller
+        size_t ffdcLen =
+            (distanceToStatusHeader - LENGTH_OF_RESP_HEADER_IN_WORDS -
+             LENGTH_OF_DISTANCE_HEADER_IN_WORDS);
         if (ffdcLen)
         {
             std::vector<sbe_word_t> ffdcData(ffdcLen);
-            //Fetch the offset of FFDC data
+            // Fetch the offset of FFDC data
             auto ffdcOffset = (lengthObtained - distanceToStatusHeader) +
                               LENGTH_OF_RESP_HEADER_IN_WORDS;
             std::copy_n((sbeDataBuf.begin() + ffdcOffset), ffdcLen,
                         ffdcData.begin());
         }
 
-        //TODO:use elog infrastructure to return the SBE and Hardware procedure
-        //FFDC container back to the caller.
+        // TODO:use elog infrastructure to return the SBE and Hardware procedure
+        // FFDC container back to the caller.
         std::ostringstream errMsg;
-        errMsg << "Chip operation failed with SBE response code:" << l_priSecResp
+        errMsg << "Chip operation failed with SBE response code:"
+               << l_priSecResp
                << ".Length of FFDC data of obtained:" << ffdcLen;
         throw std::runtime_error(errMsg.str().c_str());
     }
 
-    //In case of success, remove the response header content and send only the
-    //data.Response header will be towards the end of the buffer.
+    // In case of success, remove the response header content and send only the
+    // data.Response header will be towards the end of the buffer.
     auto respLen = (lengthObtained - distanceToStatusHeader);
     iter = sbeDataBuf.begin();
-    std::advance(iter,respLen);
+    std::advance(iter, respLen);
     sbeDataBuf.erase(iter, sbeDataBuf.end());
 }
 
-}
-}
-}
+} // namespace internal
+} // namespace sbe
+} // namespace openpower
diff --git a/sbe_chipOp_handler.hpp b/sbe_chipOp_handler.hpp
index 3e29c1e..d90558a 100644
--- a/sbe_chipOp_handler.hpp
+++ b/sbe_chipOp_handler.hpp
@@ -1,11 +1,11 @@
 #pragma once
 
-#include <stdexcept>
-#include <array>
-#include <sstream>
 #include <algorithm>
-#include <vector>
+#include <array>
 #include <sbe_interfaces.hpp>
+#include <sstream>
+#include <stdexcept>
+#include <vector>
 
 namespace openpower
 {
@@ -34,8 +34,7 @@
  */
 std::vector<sbe_word_t> writeToFifo(const char* devPath,
                                     const sbe_word_t* cmdBuffer,
-                                    size_t cmdBufLen,
-                                    size_t respBufLen);
+                                    size_t cmdBufLen, size_t respBufLen);
 
 /**
  * @brief Helper function for invokeSBEChipOperation(), to parse and validate
@@ -53,7 +52,7 @@
  */
 void parseResponse(std::vector<sbe_word_t>& sbeDataBuf);
 
-}//end of internal namespace
+} // namespace internal
 
 /**
  * @brief Interface to invoke a SBE chip operation.It calls internal API to
@@ -70,34 +69,35 @@
  * @tparam S1 Length of request buffer to be send to SBE
  * @tparam S2 Expected length of data from the SBE
  */
-template<size_t S1, size_t S2>
+template <size_t S1, size_t S2>
 inline void invokeSBEChipOperation(const char* devPath,
                                    const std::array<sbe_word_t, S1>& request,
                                    std::array<sbe_word_t, S2>& chipOpData)
 {
-    //Write and read from the FIFO device.
+    // Write and read from the FIFO device.
     auto sbeFifoResp = internal::writeToFifo(devPath, request.data(),
-                       request.size(), chipOpData.size());
+                                             request.size(), chipOpData.size());
 
-    //Parse the obtained data
+    // Parse the obtained data
     internal::parseResponse(sbeFifoResp);
-    //Above interface would have stripped the SBE header content from the input
-    //response buffer.
+    // Above interface would have stripped the SBE header content from the input
+    // response buffer.
     if (sbeFifoResp.size() > chipOpData.size())
     {
-        //TODO:use elog infrastructure
+        // TODO:use elog infrastructure
         std::ostringstream errMsg;
-        errMsg << "Obtained chip operation response length (" <<
-               sbeFifoResp.size() << "from SBE is greater than maximum expected"
-               " length:" << chipOpData.size();
+        errMsg << "Obtained chip operation response length ("
+               << sbeFifoResp.size()
+               << "from SBE is greater than maximum expected"
+                  " length:"
+               << chipOpData.size();
 
         throw std::runtime_error(errMsg.str().c_str());
     }
 
-    //Move the contents of response buffer into the output buffer.
+    // Move the contents of response buffer into the output buffer.
     std::move(sbeFifoResp.begin(), sbeFifoResp.end(), chipOpData.begin());
 }
 
-}
-}
-
+} // namespace sbe
+} // namespace openpower
diff --git a/sbe_interfaces.cpp b/sbe_interfaces.cpp
old mode 100755
new mode 100644
index 195c1f7..bf777b2
--- a/sbe_interfaces.cpp
+++ b/sbe_interfaces.cpp
@@ -1,9 +1,12 @@
+#include "sbe_interfaces.hpp"
+
+#include "sbe_chipOp_handler.hpp"
+
+#include <endian.h>
+
+#include <array>
 #include <iostream>
 #include <stdexcept>
-#include <array>
-#include <endian.h>
-#include "sbe_interfaces.hpp"
-#include "sbe_chipOp_handler.hpp"
 
 namespace openpower
 {
@@ -12,7 +15,7 @@
 
 constexpr size_t RESP_HEADER_LEN = 0x3;
 
-//Helper interfaces
+// Helper interfaces
 static inline uint32_t upper(uint64_t value)
 {
     return ((value & 0xFFFFFFFF00000000ull) >> 32);
@@ -28,79 +31,70 @@
 namespace scom
 {
 
-//Constants specific to SCOM operations
-static constexpr sbe_word_t READ_OPCODE  = 0x0000A201;
+// Constants specific to SCOM operations
+static constexpr sbe_word_t READ_OPCODE = 0x0000A201;
 static constexpr sbe_word_t WRITE_OPCODE = 0x0000A202;
 static constexpr size_t READ_CMD_LENGTH = 0x4;
 static constexpr size_t WRITE_CMD_LENGTH = 0x6;
 static constexpr size_t READ_RESP_LENGTH = 0x2;
 
-//Reading SCOM Registers
-uint64_t read(const char* devPath,
-              uint64_t address)
+// Reading SCOM Registers
+uint64_t read(const char* devPath, uint64_t address)
 {
     uint64_t value = 0;
 
-    //Validate input device path
+    // Validate input device path
     if (devPath == nullptr)
     {
         throw std::runtime_error("NULL FIFO device path");
     }
 
-    //Build SCOM read request command.
-    //Handle byte order mismatch ,SBE is big endian and BMC is
-    //little endian.
-    std::array<sbe_word_t, READ_CMD_LENGTH> command =
-    {
-        static_cast<sbe_word_t>(htobe32(READ_CMD_LENGTH)),
-        htobe32(READ_OPCODE),
-        htobe32(upper(address)),
-        htobe32(lower(address))
-    };
+    // Build SCOM read request command.
+    // Handle byte order mismatch ,SBE is big endian and BMC is
+    // little endian.
+    std::array<sbe_word_t, READ_CMD_LENGTH> command = {
+        static_cast<sbe_word_t>(htobe32(READ_CMD_LENGTH)), htobe32(READ_OPCODE),
+        htobe32(upper(address)), htobe32(lower(address))};
 
-    //Buffer to hold the response data along with the SBE header
-    const size_t respLength = RESP_HEADER_LEN + READ_RESP_LENGTH ;
+    // Buffer to hold the response data along with the SBE header
+    const size_t respLength = RESP_HEADER_LEN + READ_RESP_LENGTH;
     std::array<sbe_word_t, respLength> response = {};
 
-    //Write the command buffer to the SBE FIFO and obtain the response from the
-    //SBE FIFO device.This interface will parse the obtained SBE response and
-    //any internal SBE failures will be communicated via exceptions
+    // Write the command buffer to the SBE FIFO and obtain the response from the
+    // SBE FIFO device.This interface will parse the obtained SBE response and
+    // any internal SBE failures will be communicated via exceptions
     invokeSBEChipOperation(devPath, command, response);
 
     value = (((static_cast<uint64_t>(response[0])) << 32) | response[1]);
     return value;
 }
 
-void write(const char* devPath,
-           uint64_t address,
-           uint64_t data)
+void write(const char* devPath, uint64_t address, uint64_t data)
 {
-    //Validate input device path
+    // Validate input device path
     if (devPath == nullptr)
     {
         throw std::runtime_error("NULL FIFO device path");
     }
 
-    //Build SCOM write request command
-    //Handle byte order mismatch, SBE is big endian and BMC is
-    //little endian.
-    std::array<sbe_word_t, WRITE_CMD_LENGTH> command =
-    {
+    // Build SCOM write request command
+    // Handle byte order mismatch, SBE is big endian and BMC is
+    // little endian.
+    std::array<sbe_word_t, WRITE_CMD_LENGTH> command = {
         static_cast<sbe_word_t>(htobe32(WRITE_CMD_LENGTH)),
         htobe32(WRITE_OPCODE),
         htobe32(upper(address)),
         htobe32(lower(address)),
         htobe32(upper(data)),
-        htobe32(lower(data))
-    };
+        htobe32(lower(data))};
 
-    //Buffer to hold the SBE response status
+    // Buffer to hold the SBE response status
     const size_t respLength = RESP_HEADER_LEN;
     std::array<sbe_word_t, respLength> response = {};
 
-    //Write the command buffer to the SBE FIFO and obtain the response from the
-    //SBE FIFO device.This interface will parse the obtained SBE response and
-    //any internal SBE failures will be communicated via exceptions
+    // Write the command buffer to the SBE FIFO and obtain the response from the
+    // SBE FIFO device.This interface will parse the obtained SBE response and
+    // any internal SBE failures will be communicated via exceptions
     invokeSBEChipOperation(devPath, command, response);
 }
 
diff --git a/sbe_interfaces.hpp b/sbe_interfaces.hpp
old mode 100755
new mode 100644
index ab3877e..61ff37c
--- a/sbe_interfaces.hpp
+++ b/sbe_interfaces.hpp
@@ -18,9 +18,7 @@
  * @param[in] SCOM register address.
  * @return The register data
  */
-uint64_t read(const char* devPath,
-              uint64_t address);
-
+uint64_t read(const char* devPath, uint64_t address);
 
 /**
  * @brief Write processor SCOM register.
@@ -31,10 +29,8 @@
  * @param[in] SCOM register address.
  * @param[in] Data to be written into the register.
  */
-void write(const char* devPath,
-           uint64_t address,
-           uint64_t data);
+void write(const char* devPath, uint64_t address, uint64_t data);
 
-}//namespace scom
-}//namespace sbe
-}//namespace openpower
+} // namespace scom
+} // namespace sbe
+} // namespace openpower