Update to clang 10
Change code style to clang 10.
Change-Id: I42b0819bbeaf9dc68a99065d2df0e6ceb2eeedd0
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/include/commandutils.hpp b/include/commandutils.hpp
index c59a77f..17762a9 100644
--- a/include/commandutils.hpp
+++ b/include/commandutils.hpp
@@ -15,9 +15,10 @@
*/
#pragma once
-#include <iostream>
#include <sdbusplus/bus.hpp>
+#include <iostream>
+
static constexpr bool debug = false;
inline static void printRegistration(unsigned int netfn, unsigned int cmd)
diff --git a/include/oemcommands.hpp b/include/oemcommands.hpp
index 8599af4..7a6653b 100644
--- a/include/oemcommands.hpp
+++ b/include/oemcommands.hpp
@@ -138,17 +138,17 @@
#define BOOT_SEQ_ARRAY_SIZE 10
-const char *bootSeq[] = {"USB_DEV", "NET_IPV4", "SATA_HDD", "SATA_CD",
+const char* bootSeq[] = {"USB_DEV", "NET_IPV4", "SATA_HDD", "SATA_CD",
"OTHER", "", "", "",
"", "NET_IPV6"};
std::map<std::string, int> bootMap = {{"USB_DEV", 0}, {"NET_IPV4", 1},
{"NET_IPV6", 9}, {"SATA_HDD", 2},
{"SATA_CD", 3}, {"OTHER", 4}};
-const char *chassisType[] = {"ORV1", "ORV2"};
-const char *mbType[] = {"SS", "DS", "TYPE3"};
-const char *riserType[] = {"NO_CARD", "2_SLOT", "3_SLOT"};
-const char *pcieType[] = {"ABSENT", "AVA1", "AVA2", "AVA3",
+const char* chassisType[] = {"ORV1", "ORV2"};
+const char* mbType[] = {"SS", "DS", "TYPE3"};
+const char* riserType[] = {"NO_CARD", "2_SLOT", "3_SLOT"};
+const char* pcieType[] = {"ABSENT", "AVA1", "AVA2", "AVA3",
"AVA4", "Re-timer", "HBA", "OTHER"};
enum fb_ppr_sel
@@ -216,15 +216,15 @@
uint8_t data[];
} qDriveInfo_t;
-const char *cpuInfoKey[] = {"", "product_name", "basic_info",
+const char* cpuInfoKey[] = {"", "product_name", "basic_info",
"type", "micro_code", "turbo_mode"};
-const char *dimmInfoKey[] = {
+const char* dimmInfoKey[] = {
"", "location", "type", "speed", "part_name",
"serial_num", "manufacturer_id", "status", "present_bit"};
-const char *driveInfoKey[] = {"location", "serial_num", "model_name",
+const char* driveInfoKey[] = {"location", "serial_num", "model_name",
"fw_version", "capacity", "quantity",
"type", "wwn"};
-const char *ctrlTypeKey[] = {"bios", "expander", "lsi"};
+const char* ctrlTypeKey[] = {"bios", "expander", "lsi"};
diff --git a/include/sdrutils.hpp b/include/sdrutils.hpp
index 317ec06..138df11 100644
--- a/include/sdrutils.hpp
+++ b/include/sdrutils.hpp
@@ -1,10 +1,10 @@
#pragma once
-#include <ipmid/types.hpp>
-
#include <ipmid/api.h>
#include <stdint.h>
+#include <ipmid/types.hpp>
+
/**
* Get SDR
*/
diff --git a/include/sensorutils.hpp b/include/sensorutils.hpp
index 5b9fbb2..6af1d63 100644
--- a/include/sensorutils.hpp
+++ b/include/sensorutils.hpp
@@ -18,9 +18,10 @@
#pragma once
#include <ipmid/api.h>
+#include <phosphor-logging/log.hpp>
+
#include <cmath>
#include <iostream>
-#include <phosphor-logging/log.hpp>
namespace ipmi
{
@@ -63,9 +64,9 @@
boost::container::flat_map<std::string, std::vector<std::string>>,
CmpStrVersion>;
-inline static bool getSensorSubtree(SensorSubTree &subtree)
+inline static bool getSensorSubtree(SensorSubTree& subtree)
{
- sd_bus *bus = NULL;
+ sd_bus* bus = NULL;
int ret = sd_bus_default_system(&bus);
if (ret < 0)
{
@@ -81,7 +82,7 @@
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree");
static constexpr const auto depth = 2;
- static constexpr std::array<const char *, 3> interfaces = {
+ static constexpr std::array<const char*, 3> interfaces = {
"xyz.openbmc_project.Sensor.Value",
"xyz.openbmc_project.Sensor.Threshold.Warning",
"xyz.openbmc_project.Sensor.Threshold.Critical"};
@@ -93,7 +94,7 @@
subtree.clear();
mapperReply.read(subtree);
}
- catch (sdbusplus::exception_t &e)
+ catch (sdbusplus::exception_t& e)
{
phosphor::logging::log<phosphor::logging::level::ERR>(e.what());
return false;
@@ -104,20 +105,20 @@
// Specify the comparison required to sort and find char* map objects
struct CmpStr
{
- bool operator()(const char *a, const char *b) const
+ bool operator()(const char* a, const char* b) const
{
return std::strcmp(a, b) < 0;
}
};
-const static boost::container::flat_map<const char *, SensorUnits, CmpStr>
+const static boost::container::flat_map<const char*, SensorUnits, CmpStr>
sensorUnits{{{"temperature", SensorUnits::degreesC},
{"voltage", SensorUnits::volts},
{"current", SensorUnits::amps},
{"fan_tach", SensorUnits::rpm},
{"power", SensorUnits::watts}}};
-const static boost::container::flat_map<const char *, SensorTypeCodes, CmpStr>
+const static boost::container::flat_map<const char*, SensorTypeCodes, CmpStr>
sensorTypes{{{"temperature", SensorTypeCodes::temperature},
{"voltage", SensorTypeCodes::voltage},
{"current", SensorTypeCodes::current},
@@ -125,7 +126,7 @@
{"fan_pwm", SensorTypeCodes::fan},
{"power", SensorTypeCodes::other}}};
-inline static std::string getSensorTypeStringFromPath(const std::string &path)
+inline static std::string getSensorTypeStringFromPath(const std::string& path)
{
// get sensor type string from path, path is defined as
// /xyz/openbmc_project/sensors/<type>/label
@@ -144,7 +145,7 @@
return path.substr(typeStart, typeEnd - typeStart);
}
-inline static uint8_t getSensorTypeFromPath(const std::string &path)
+inline static uint8_t getSensorTypeFromPath(const std::string& path)
{
uint8_t sensorType = 0;
std::string type = getSensorTypeStringFromPath(path);
@@ -157,16 +158,16 @@
return sensorType;
}
-inline static uint8_t getSensorEventTypeFromPath(const std::string &path)
+inline static uint8_t getSensorEventTypeFromPath(const std::string& path)
{
// TODO: Add support for additional reading types as needed
return 0x1; // reading type = threshold
}
static inline bool getSensorAttributes(const double max, const double min,
- int16_t &mValue, int8_t &rExp,
- int16_t &bValue, int8_t &bExp,
- bool &bSigned)
+ int16_t& mValue, int8_t& rExp,
+ int16_t& bValue, int8_t& bExp,
+ bool& bSigned)
{
// computing y = (10^rRexp) * (Mx + (B*(10^Bexp)))
// check for 0, assume always positive