diff options
| author | Patrick Venture <venture@google.com> | 2018-10-30 08:42:53 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2018-10-30 08:51:55 -0700 |
| commit | f3252315f364deef288bbcaebee292e94106713a (patch) | |
| tree | 1a904bbd88eae51cb22ab24a635a6a8c49b4d06a | |
| parent | 65ea92e7ffe197920610c346e5b3a805f4005ebf (diff) | |
| download | phosphor-pid-control-f3252315f364deef288bbcaebee292e94106713a.tar.gz phosphor-pid-control-f3252315f364deef288bbcaebee292e94106713a.zip | |
style: fixup naming of structures
Fixup naming of structures to UpperCamel.
Change-Id: I6a9bf0b954298089c85d3362e86cd95b3fc5b944
Signed-off-by: Patrick Venture <venture@google.com>
| -rw-r--r-- | conf.hpp | 8 | ||||
| -rw-r--r-- | dbus/dbusconfiguration.cpp | 8 | ||||
| -rw-r--r-- | main.cpp | 4 | ||||
| -rw-r--r-- | pid/builder.cpp | 6 | ||||
| -rw-r--r-- | pid/builder.hpp | 4 | ||||
| -rw-r--r-- | pid/builderconfig.cpp | 6 | ||||
| -rw-r--r-- | scripts/writesensor.mako.cpp | 2 | ||||
| -rw-r--r-- | scripts/writezone.mako.cpp | 2 | ||||
| -rw-r--r-- | sensors/builder.cpp | 5 | ||||
| -rw-r--r-- | sensors/builder.hpp | 3 | ||||
| -rw-r--r-- | sensors/builderconfig.cpp | 4 |
11 files changed, 27 insertions, 25 deletions
@@ -10,7 +10,7 @@ /* * General sensor structure used for configuration. */ -struct sensor +struct SensorConfig { /* Used for listen if readpath is passive. */ std::string type; @@ -26,7 +26,7 @@ struct sensor /* * Structure for holding the configuration of a PID. */ -struct controller_info +struct ControllerInfo { std::string type; // fan or margin or temp? std::vector<std::string> inputs; // one or more sensors. @@ -43,7 +43,7 @@ struct controller_info * and a set of configuration settings. This structure gets filled out with * the zone configuration settings and not the PID details. */ -struct zone +struct ZoneConfig { /* The minimum RPM value we would ever want. */ float minthermalrpm; @@ -52,4 +52,4 @@ struct zone float failsafepercent; }; -using PIDConf = std::map<std::string, struct controller_info>; +using PIDConf = std::map<std::string, struct ControllerInfo>; diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp index 0a7c502..9a03c0b 100644 --- a/dbus/dbusconfiguration.cpp +++ b/dbus/dbusconfiguration.cpp @@ -30,9 +30,9 @@ static constexpr bool DEBUG = false; // enable to print found configuration -std::map<std::string, struct sensor> SensorConfig = {}; +std::map<std::string, struct SensorConfig> SensorConfig = {}; std::map<int64_t, PIDConf> ZoneConfig = {}; -std::map<int64_t, struct zone> ZoneDetailsConfig = {}; +std::map<int64_t, struct ZoneConfig> ZoneDetailsConfig = {}; constexpr const char* pidConfigurationInterface = "xyz.openbmc_project.Configuration.Pid"; @@ -397,7 +397,7 @@ void init(sdbusplus::bus::bus& bus) { continue; } - struct controller_info& info = + struct ControllerInfo& info = conf[variant_ns::get<std::string>(base.at("Name"))]; info.inputs = std::move(inputs); @@ -490,7 +490,7 @@ void init(sdbusplus::bus::bus& bus) { continue; } - struct controller_info& info = + struct ControllerInfo& info = conf[variant_ns::get<std::string>(base.at("Name"))]; info.inputs = std::move(inputs); @@ -46,11 +46,11 @@ #endif /* The YAML converted sensor list. */ -extern std::map<std::string, struct sensor> SensorConfig; +extern std::map<std::string, struct SensorConfig> SensorConfig; /* The YAML converted PID list. */ extern std::map<int64_t, PIDConf> ZoneConfig; /* The YAML converted Zone configuration. */ -extern std::map<int64_t, struct zone> ZoneDetailsConfig; +extern std::map<int64_t, struct ZoneConfig> ZoneDetailsConfig; int main(int argc, char* argv[]) { diff --git a/pid/builder.cpp b/pid/builder.cpp index 5d8f62f..fece41b 100644 --- a/pid/builder.cpp +++ b/pid/builder.cpp @@ -37,8 +37,8 @@ static std::string GetControlPath(int64_t zone) std::unordered_map<int64_t, std::unique_ptr<PIDZone>> BuildZones(std::map<int64_t, PIDConf>& zonePids, - std::map<int64_t, struct zone>& zoneConfigs, SensorManager& mgr, - sdbusplus::bus::bus& modeControlBus) + std::map<int64_t, struct ZoneConfig>& zoneConfigs, + SensorManager& mgr, sdbusplus::bus::bus& modeControlBus) { std::unordered_map<int64_t, std::unique_ptr<PIDZone>> zones; @@ -74,7 +74,7 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>> { std::vector<std::string> inputs; std::string name = pit.first; - const struct controller_info* info = &pit.second; + const struct ControllerInfo* info = &pit.second; std::cerr << "PID name: " << name << "\n"; diff --git a/pid/builder.hpp b/pid/builder.hpp index 9201b9a..8891531 100644 --- a/pid/builder.hpp +++ b/pid/builder.hpp @@ -9,5 +9,5 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>> BuildZones(std::map<int64_t, PIDConf>& zonePids, - std::map<int64_t, struct zone>& zoneConfigs, SensorManager& mgr, - sdbusplus::bus::bus& modeControlBus); + std::map<int64_t, struct ZoneConfig>& zoneConfigs, + SensorManager& mgr, sdbusplus::bus::bus& modeControlBus); diff --git a/pid/builderconfig.cpp b/pid/builderconfig.cpp index c72ef9e..4909713 100644 --- a/pid/builderconfig.cpp +++ b/pid/builderconfig.cpp @@ -35,7 +35,7 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>> // zone -> pids std::map<int64_t, PIDConf> pidConfig; // zone -> configs - std::map<int64_t, struct zone> zoneConfig; + std::map<int64_t, struct ZoneConfig> zoneConfig; std::cerr << "entered BuildZonesFromConfig\n"; @@ -72,7 +72,7 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>> int id; PIDConf thisZone; - struct zone thisZoneConfig; + struct ZoneConfig thisZoneConfig; zoneSettings.lookupValue("id", id); @@ -88,7 +88,7 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>> const Setting& pid = pids[j]; std::string name; - controller_info info; + struct ControllerInfo info; /* * Mysteriously if you use lookupValue on these, and the type diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp index 8be30bb..6f81e82 100644 --- a/scripts/writesensor.mako.cpp +++ b/scripts/writesensor.mako.cpp @@ -6,7 +6,7 @@ #include <map> #include "conf.hpp" -std::map<std::string, struct sensor> SensorConfig = { +std::map<std::string, struct SensorConfig> SensorConfig = { % for key in sensorDict.iterkeys(): % if key: <% diff --git a/scripts/writezone.mako.cpp b/scripts/writezone.mako.cpp index 57b9908..2598613 100644 --- a/scripts/writezone.mako.cpp +++ b/scripts/writezone.mako.cpp @@ -6,7 +6,7 @@ #include <map> #include "conf.hpp" -std::map<int64_t, struct zone> ZoneDetailsConfig = { +std::map<int64_t, struct ZoneConfig> ZoneDetailsConfig = { % for zone in ZoneDict.iterkeys(): % if zone: <% diff --git a/sensors/builder.cpp b/sensors/builder.cpp index 7927dd0..a43a731 100644 --- a/sensors/builder.cpp +++ b/sensors/builder.cpp @@ -36,7 +36,8 @@ static constexpr bool deferSignals = true; static DbusHelper helper; -SensorManager BuildSensors(const std::map<std::string, struct sensor>& config) +SensorManager + BuildSensors(const std::map<std::string, struct SensorConfig>& config) { SensorManager mgmr; auto& HostSensorBus = mgmr.getHostBus(); @@ -48,7 +49,7 @@ SensorManager BuildSensors(const std::map<std::string, struct sensor>& config) std::unique_ptr<WriteInterface> wi; std::string name = it.first; - const struct sensor* info = &it.second; + const struct SensorConfig* info = &it.second; std::cerr << "Sensor: " << name << " " << info->type << " "; std::cerr << info->readpath << " " << info->writepath << "\n"; diff --git a/sensors/builder.hpp b/sensors/builder.hpp index 78a578a..fdf1c9b 100644 --- a/sensors/builder.hpp +++ b/sensors/builder.hpp @@ -9,4 +9,5 @@ /** * Build the sensors and associate them with a SensorManager. */ -SensorManager BuildSensors(const std::map<std::string, struct sensor>& config); +SensorManager + BuildSensors(const std::map<std::string, struct SensorConfig>& config); diff --git a/sensors/builderconfig.cpp b/sensors/builderconfig.cpp index cb3fd81..f87e572 100644 --- a/sensors/builderconfig.cpp +++ b/sensors/builderconfig.cpp @@ -33,7 +33,7 @@ SensorManager BuildSensorsFromConfig(const std::string& path) { using namespace libconfig; - std::map<std::string, struct sensor> config; + std::map<std::string, struct SensorConfig> config; Config cfg; std::cerr << "entered BuildSensorsFromConfig\n"; @@ -69,7 +69,7 @@ SensorManager BuildSensorsFromConfig(const std::string& path) const Setting& sensor = sensors[i]; std::string name; - struct sensor thisOne; + struct SensorConfig thisOne; /* Not a super fan of using this library for run-time configuration. */ |

