summaryrefslogtreecommitdiffstats
path: root/readeeprom.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-16 17:18:43 -0700
committerPatrick Venture <venture@google.com>2018-10-17 10:50:20 -0700
commitc9508db8d33f4394e7c632b2c5cd15febaa8bf5e (patch)
treeb55c60c320363a9540da430725579910c43117fb /readeeprom.cpp
parent0d963f5938e68e05389fb479370f5d5fe8626729 (diff)
downloadipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.tar.gz
ipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.zip
add clang-format
Add clang-format file. Change-Id: Ib99bbeb0ec59b5befb742dec38286c24a7f842ea Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'readeeprom.cpp')
-rw-r--r--readeeprom.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/readeeprom.cpp b/readeeprom.cpp
index ef7e559..b8b2fd8 100644
--- a/readeeprom.cpp
+++ b/readeeprom.cpp
@@ -1,8 +1,9 @@
-#include <iostream>
-#include <memory>
#include "argument.hpp"
#include "writefrudata.hpp"
+#include <iostream>
+#include <memory>
+
static void exit_with_error(const char* err, char** argv)
{
ArgumentParser::usage(argv);
@@ -14,13 +15,13 @@ static void exit_with_error(const char* err, char** argv)
//--------------------------------------------------------------------------
// This gets called by udev monitor soon after seeing hog plugs for EEPROMS.
//--------------------------------------------------------------------------
-int main(int argc, char **argv)
+int main(int argc, char** argv)
{
int rc = 0;
uint8_t fruid = 0;
// Handle to per process system bus
- sd_bus *bus_type = NULL;
+ sd_bus* bus_type = NULL;
// Read the arguments.
auto cli_options = std::make_unique<ArgumentParser>(argc, argv);
@@ -42,7 +43,7 @@ int main(int argc, char **argv)
// Extract the fruid
fruid = strtol(fruid_str.c_str(), NULL, 16);
- if(fruid == 0)
+ if (fruid == 0)
{
// User has not passed in the appropriate argument value
exit_with_error("Invalid fruid.", argv);
@@ -55,14 +56,15 @@ int main(int argc, char **argv)
rc = sd_bus_open_system(&bus_type);
if (rc < 0)
{
- fprintf(stderr, "Failed to connect to system bus: %s\n",strerror(-rc));
+ fprintf(stderr, "Failed to connect to system bus: %s\n", strerror(-rc));
}
else
{
- // Now that we have the file that contains the eeprom data, go read it and
- // update the Inventory DB.
+ // Now that we have the file that contains the eeprom data, go read it
+ // and update the Inventory DB.
bool bmc_fru = true;
- rc = ipmi_validate_fru_area(fruid, eeprom_file.c_str(), bus_type, bmc_fru);
+ rc = ipmi_validate_fru_area(fruid, eeprom_file.c_str(), bus_type,
+ bmc_fru);
}
// Cleanup
OpenPOWER on IntegriCloud