diff options
author | Brandon Wyman <v2cib530@us.ibm.com> | 2017-06-21 13:17:35 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-06-26 01:28:17 +0000 |
commit | 2f370c4e351adb90dc218d719b962cb841a399eb (patch) | |
tree | eb4e2e78fb47bc118fa9148fe4c0d016f3e42a98 /sysfs.cpp | |
parent | ac8b7c6b71f089a9054e34d555c14ad14dd501b4 (diff) | |
download | phosphor-hwmon-2f370c4e351adb90dc218d719b962cb841a399eb.tar.gz phosphor-hwmon-2f370c4e351adb90dc218d719b962cb841a399eb.zip |
Fix high CPU usage noted with BMP280
The call to findCallOutPath() is really only needed if we have
encountered a read or write error.
Change-Id: I81136156ba3a42546a5e2cec85283a0082358853
Signed-off-by: Brandon Wyman <v2cib530@us.ibm.com>
Diffstat (limited to 'sysfs.cpp')
-rw-r--r-- | sysfs.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -162,8 +162,6 @@ int readSysfsWithCallout(const std::string& root, std::string fullPath = make_sysfs_path(instancePath, type, id, sensor); - auto callOutPath = findCalloutPath(fs::canonical(instancePath)); - ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit | std::ifstream::eofbit); @@ -193,6 +191,7 @@ int readSysfsWithCallout(const std::string& root, exit(0); } instancePath /= "device"; + auto callOutPath = findCalloutPath(fs::canonical(instancePath)); using namespace sdbusplus::xyz::openbmc_project::Sensor::Device::Error; report<ReadFailure>( xyz::openbmc_project::Sensor::Device:: @@ -223,8 +222,6 @@ uint64_t writeSysfsWithCallout(const uint64_t& value, std::string fullPath = make_sysfs_path(instancePath, type, id, sensor); - auto callOutPath = findCalloutPath(fs::canonical(instancePath)); - ofs.exceptions(std::ofstream::failbit | std::ofstream::badbit | std::ofstream::eofbit); @@ -239,6 +236,7 @@ uint64_t writeSysfsWithCallout(const uint64_t& value, // or write system calls that got us here. auto rc = errno; instancePath /= "device"; + auto callOutPath = findCalloutPath(fs::canonical(instancePath)); using namespace sdbusplus::xyz::openbmc_project::Control::Device::Error; report<WriteFailure>( xyz::openbmc_project::Control::Device:: |