build: Migrate to meson and add clang-format
Removed the Cmake files and cleanup formatting errors.
Change-Id: I787041507d3ff6afc6b4a3af3930e8d8363c9570
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/src/bioscommands.cpp b/src/bioscommands.cpp
index eb7fa08..361b809 100644
--- a/src/bioscommands.cpp
+++ b/src/bioscommands.cpp
@@ -1,3 +1,4 @@
+// clang-format off
/********************************************************************************
* HON HAI Precision IND.Co., LTD. *
* Personal Computer & Enterprise Product Business Group *
@@ -13,13 +14,14 @@
* permission of FOXCONN/CESBG/CABG/SRD. *
* *
********************************************************************************/
+// clang-format on
-#include <ipmid/api.hpp>
-#include <phosphor-logging/log.hpp>
-#include <sdbusplus/message/types.hpp>
#include <bioscommands.hpp>
#include <boost/endian/arithmetic.hpp>
#include <file_handling.hpp>
+#include <ipmid/api.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/message/types.hpp>
struct bios_boot_count
{
@@ -30,46 +32,47 @@
namespace ipmi
{
static void registerBIOSFunctions() __attribute__((constructor));
-ipmi::RspType<uint32_t> FiiBIOSBootCount(boost::asio::yield_context yield,
- std::vector<uint8_t> reqParams)
+ipmi::RspType<uint32_t>
+ FiiBIOSBootCount([[maybe_unused]] boost::asio::yield_context yield,
+ std::vector<uint8_t> reqParams)
{
int boot_count_operation;
bios_boot_count boot;
if (reqParams.empty())
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- " Fii bios cmd : command format error.");
+ " Fii bios cmd : command format error.");
return ipmi::responseReqDataLenInvalid();
}
boot_count_operation = reqParams[0];
- if((boot_count_operation == BOOT_COUNT_SET &&
- reqParams.size() != SET_BYTE_LENGTH) ||
+ if ((boot_count_operation == BOOT_COUNT_SET &&
+ reqParams.size() != SET_BYTE_LENGTH) ||
(boot_count_operation != BOOT_COUNT_SET &&
reqParams.size() != OPERATION_BYTE_LENGTH))
{
- return ipmi::responseReqDataLenInvalid();
+ return ipmi::responseReqDataLenInvalid();
}
- if(boot_count_operation > BOOT_COUNT_SET)
+ if (boot_count_operation > BOOT_COUNT_SET)
{
- return ipmi::responseInvalidCommand();
+ return ipmi::responseInvalidCommand();
}
int fd = sysopen(EEPROM_PATH);
readBin(fd, EEPROM_OFFSET, &boot, sizeof(boot));
- if(boot.header != BOOT_COUNT_HEADER)
+ if (boot.header != BOOT_COUNT_HEADER)
{
phosphor::logging::log<phosphor::logging::level::INFO>(
- "Boot count header is corrupted or missing. Initializing.");
+ "Boot count header is corrupted or missing. Initializing.");
boot.header = BOOT_COUNT_HEADER;
boot.count = INITIAL_VALUE;
writeBin(fd, EEPROM_OFFSET, &boot, sizeof(boot));
}
- switch(boot_count_operation)
+ switch (boot_count_operation)
{
case BOOT_COUNT_READ:
break;
@@ -84,19 +87,22 @@
break;
}
- if( boot_count_operation != BOOT_COUNT_READ )
+ if (boot_count_operation != BOOT_COUNT_READ)
{
writeBin(fd, EEPROM_OFFSET + 4, &boot.count, sizeof(boot.count));
- }
+ }
sysclose(fd);
return ipmi::responseSuccess(boot.count);
}
void registerBIOSFunctions()
{
- std::fprintf(stderr, "Registering OEM:[0x34], Cmd:[%#04X] for Fii BIOS OEM Commands\n",
- FII_CMD_BIOS_BOOT_COUNT);
- ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnOemThree, FII_CMD_BIOS_BOOT_COUNT,
- ipmi::Privilege::User, FiiBIOSBootCount);
+ std::fprintf(
+ stderr,
+ "Registering OEM:[0x34], Cmd:[%#04X] for Fii BIOS OEM Commands\n",
+ FII_CMD_BIOS_BOOT_COUNT);
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::netFnOemThree,
+ FII_CMD_BIOS_BOOT_COUNT, ipmi::Privilege::User,
+ FiiBIOSBootCount);
}
-}
+} // namespace ipmi