sysfs: Fix readability-identifier-naming
```
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../sysfs.cpp:30:3: error: invalid case style for function 'get_sysfs_attr' [readability-identifier-naming,-warnings-as-errors]
T get_sysfs_attr(const fs::path& path);
^~~~~~~~~~~~~~
getSysfsAttr
/home/andrew/src/openbmc/phosphor-led-sysfs/build/../sysfs.cpp:49:6: error: invalid case style for function 'set_sysfs_attr' [readability-identifier-naming,-warnings-as-errors]
void set_sysfs_attr(const fs::path& path, const T& value)
^~~~~~~~~~~~~~
setSysfsAttr
```
Change-Id: I1371768b35a65345a634c444d798f8dd8ba8f198
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/sysfs.cpp b/sysfs.cpp
index 33c9f49..6039298 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -27,10 +27,10 @@
namespace led
{
template <typename T>
-T get_sysfs_attr(const fs::path& path);
+T getSysfsAttr(const fs::path& path);
template <>
-std::string get_sysfs_attr(const fs::path& path)
+std::string getSysfsAttr(const fs::path& path)
{
std::string content;
std::ifstream file(path);
@@ -39,14 +39,14 @@
}
template <>
-unsigned long get_sysfs_attr(const fs::path& path)
+unsigned long getSysfsAttr(const fs::path& path)
{
- std::string content = get_sysfs_attr<std::string>(std::move(path));
+ std::string content = getSysfsAttr<std::string>(std::move(path));
return std::strtoul(content.c_str(), nullptr, 0);
}
template <typename T>
-void set_sysfs_attr(const fs::path& path, const T& value)
+void setSysfsAttr(const fs::path& path, const T& value)
{
std::ofstream file(path);
file << value;
@@ -54,47 +54,47 @@
unsigned long SysfsLed::getBrightness()
{
- return get_sysfs_attr<unsigned long>(root / BRIGHTNESS);
+ return getSysfsAttr<unsigned long>(root / BRIGHTNESS);
}
void SysfsLed::setBrightness(unsigned long brightness)
{
- set_sysfs_attr<unsigned long>(root / BRIGHTNESS, brightness);
+ setSysfsAttr<unsigned long>(root / BRIGHTNESS, brightness);
}
unsigned long SysfsLed::getMaxBrightness()
{
- return get_sysfs_attr<unsigned long>(root / MAX_BRIGHTNESS);
+ return getSysfsAttr<unsigned long>(root / MAX_BRIGHTNESS);
}
std::string SysfsLed::getTrigger()
{
- return get_sysfs_attr<std::string>(root / TRIGGER);
+ return getSysfsAttr<std::string>(root / TRIGGER);
}
void SysfsLed::setTrigger(const std::string& trigger)
{
- set_sysfs_attr<std::string>(root / TRIGGER, trigger);
+ setSysfsAttr<std::string>(root / TRIGGER, trigger);
}
unsigned long SysfsLed::getDelayOn()
{
- return get_sysfs_attr<unsigned long>(root / DELAY_ON);
+ return getSysfsAttr<unsigned long>(root / DELAY_ON);
}
void SysfsLed::setDelayOn(unsigned long ms)
{
- set_sysfs_attr<unsigned long>(root / DELAY_ON, ms);
+ setSysfsAttr<unsigned long>(root / DELAY_ON, ms);
}
unsigned long SysfsLed::getDelayOff()
{
- return get_sysfs_attr<unsigned long>(root / DELAY_OFF);
+ return getSysfsAttr<unsigned long>(root / DELAY_OFF);
}
void SysfsLed::setDelayOff(unsigned long ms)
{
- set_sysfs_attr<unsigned long>(root / DELAY_OFF, ms);
+ setSysfsAttr<unsigned long>(root / DELAY_OFF, ms);
}
} // namespace led
} // namespace phosphor