update clang-format
use openbmc standard clang-format
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ia4bcacb680b6652f0e0a762981639a5ecd924b3e
diff --git a/include/pulse_event_monitor.hpp b/include/pulse_event_monitor.hpp
index 15d2531..bdd1ee4 100644
--- a/include/pulse_event_monitor.hpp
+++ b/include/pulse_event_monitor.hpp
@@ -22,7 +22,7 @@
inline static sdbusplus::bus::match::match
startPulseEventMonitor(std::shared_ptr<sdbusplus::asio::connection> conn)
{
- auto pulseEventMatcherCallback = [](sdbusplus::message::message &msg) {
+ auto pulseEventMatcherCallback = [](sdbusplus::message::message& msg) {
std::string thresholdInterface;
boost::container::flat_map<std::string, std::variant<std::string>>
propertiesChanged;
@@ -68,7 +68,7 @@
};
sdbusplus::bus::match::match pulseEventMatcher(
- static_cast<sdbusplus::bus::bus &>(*conn),
+ static_cast<sdbusplus::bus::bus&>(*conn),
"type='signal',interface='org.freedesktop.DBus.Properties',member='"
"PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Host'",
std::move(pulseEventMatcherCallback));
diff --git a/include/sel_logger.hpp b/include/sel_logger.hpp
index bd40dff..58c7cc6 100644
--- a/include/sel_logger.hpp
+++ b/include/sel_logger.hpp
@@ -17,14 +17,14 @@
#pragma once
#include <filesystem>
-static constexpr char const *ipmiSelObject = "xyz.openbmc_project.Logging.IPMI";
-static constexpr char const *ipmiSelPath = "/xyz/openbmc_project/Logging/IPMI";
-static constexpr char const *ipmiSelAddInterface =
+static constexpr char const* ipmiSelObject = "xyz.openbmc_project.Logging.IPMI";
+static constexpr char const* ipmiSelPath = "/xyz/openbmc_project/Logging/IPMI";
+static constexpr char const* ipmiSelAddInterface =
"xyz.openbmc_project.Logging.IPMI";
// ID string generated using journalctl to include in the MESSAGE_ID field for
// SEL entries. Helps with filtering SEL entries in the journal.
-static constexpr char const *selMessageId = "b370836ccf2f4850ac5bee185b77893a";
+static constexpr char const* selMessageId = "b370836ccf2f4850ac5bee185b77893a";
static constexpr int selPriority = 5; // notice
static constexpr uint8_t selSystemType = 0x02;
static constexpr uint16_t selBMCGenID = 0x0020;
@@ -38,6 +38,6 @@
template <typename... T>
static uint16_t
- selAddSystemRecord(const std::string &message, const std::string &path,
- const std::vector<uint8_t> &selData, const bool &assert,
- const uint16_t &genId, T &&... metadata);
+ selAddSystemRecord(const std::string& message, const std::string& path,
+ const std::vector<uint8_t>& selData, const bool& assert,
+ const uint16_t& genId, T&&... metadata);
diff --git a/include/sensorutils.hpp b/include/sensorutils.hpp
index ce5d775..16eb8ce 100644
--- a/include/sensorutils.hpp
+++ b/include/sensorutils.hpp
@@ -15,9 +15,10 @@
*/
#pragma once
+#include <phosphor-logging/log.hpp>
+
#include <cmath>
#include <iostream>
-#include <phosphor-logging/log.hpp>
namespace ipmi
{
@@ -27,7 +28,8 @@
*/
struct VariantToDoubleVisitor
{
- template <typename T> double operator()(const T& t) const
+ template <typename T>
+ double operator()(const T& t) const
{
static_assert(std::is_arithmetic_v<T>,
"Cannot translate type to double");
diff --git a/include/threshold_event_monitor.hpp b/include/threshold_event_monitor.hpp
index b1f2eed..da63e0d 100644
--- a/include/threshold_event_monitor.hpp
+++ b/include/threshold_event_monitor.hpp
@@ -17,6 +17,7 @@
#pragma once
#include <sel_logger.hpp>
#include <sensorutils.hpp>
+
#include <string_view>
#include <variant>
@@ -37,7 +38,7 @@
std::shared_ptr<sdbusplus::asio::connection> conn)
{
auto thresholdEventMatcherCallback = [conn](
- sdbusplus::message::message &msg) {
+ sdbusplus::message::message& msg) {
// This static set of std::pair<path, event> tracks asserted events to
// avoid duplicate logs or deasserts logged without an assert
static boost::container::flat_set<std::pair<std::string, std::string>>
@@ -51,7 +52,7 @@
propertiesChanged;
msg.read(thresholdInterface, propertiesChanged);
std::string event = propertiesChanged.begin()->first;
- bool *pval = std::get_if<bool>(&propertiesChanged.begin()->second);
+ bool* pval = std::get_if<bool>(&propertiesChanged.begin()->second);
if (!pval)
{
std::cerr << "threshold event direction has invalid type\n";
@@ -121,7 +122,7 @@
conn->call(getSensorValue);
getSensorValueResp.read(sensorValue);
}
- catch (sdbusplus::exception_t &)
+ catch (sdbusplus::exception_t&)
{
std::cerr << "error getting sensor value from " << msg.get_path()
<< "\n";
@@ -159,7 +160,7 @@
{
eventData[1] = ipmi::getScaledIPMIValue(sensorVal, max, min);
}
- catch (const std::exception &e)
+ catch (const std::exception& e)
{
std::cerr << e.what();
eventData[1] = 0xFF;
@@ -185,7 +186,7 @@
conn->call(getThreshold);
getThresholdResp.read(thresholdValue);
}
- catch (sdbusplus::exception_t &)
+ catch (sdbusplus::exception_t&)
{
std::cerr << "error getting sensor threshold from "
<< msg.get_path() << "\n";
@@ -201,7 +202,7 @@
{
eventData[2] = ipmi::getScaledIPMIValue(thresholdVal, max, min);
}
- catch (const std::exception &e)
+ catch (const std::exception& e)
{
std::cerr << e.what();
eventData[2] = 0xFF;
@@ -286,7 +287,7 @@
sensorName.data(), sensorVal, thresholdVal);
};
sdbusplus::bus::match::match thresholdEventMatcher(
- static_cast<sdbusplus::bus::bus &>(*conn),
+ static_cast<sdbusplus::bus::bus&>(*conn),
"type='signal',interface='org.freedesktop.DBus.Properties',member='"
"PropertiesChanged',arg0namespace='xyz.openbmc_project.Sensor."
"Threshold'",