clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: Ia442cdc88aaeaab2f1384cc46a56f5cd5e40f2f5
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index f36605c..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -5,23 +5,24 @@
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
-AlignEscapedNewlinesLeft: false
-AlignOperands: true
-AlignTrailingComments: true
+AlignEscapedNewlines: Right
+AlignOperands: Align
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: true
+AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
- AfterCaseLabel: true
+ AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
@@ -30,19 +31,28 @@
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
+ AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
+ SplitEmptyFunction: false
+ SplitEmptyRecord: false
+ SplitEmptyNamespace: false
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
+BreakInheritanceList: AfterColon
+BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
+CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
+DeriveLineEnding: false
DerivePointerAlignment: false
PointerAlignment: Left
DisableFormat: false
@@ -52,21 +62,29 @@
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"](gtest|gmock)'
- Priority: 5
+ Priority: 7
- Regex: '^"config.h"'
Priority: -1
- - Regex: '^".*\.hpp"'
+ - Regex: '^".*\.h"'
Priority: 1
- - Regex: '^<.*\.h>'
+ - Regex: '^".*\.hpp"'
Priority: 2
- - Regex: '^<.*'
+ - Regex: '^<.*\.h>'
Priority: 3
- - Regex: '.*'
+ - Regex: '^<.*\.hpp>'
Priority: 4
+ - Regex: '^<.*'
+ Priority: 5
+ - Regex: '.*'
+ Priority: 6
IndentCaseLabels: true
+IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertNewlineAtEOF: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -74,18 +92,29 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
ReflowComments: true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
@@ -93,7 +122,7 @@
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Cpp11
+Standard: Latest
TabWidth: 4
UseTab: Never
...
diff --git a/common_utility.cpp b/common_utility.cpp
index 7b88b05..c1c5e4f 100644
--- a/common_utility.cpp
+++ b/common_utility.cpp
@@ -2,9 +2,10 @@
#include "const.hpp"
-#include <iostream>
#include <phosphor-logging/log.hpp>
+#include <iostream>
+
namespace openpower
{
namespace vpd
@@ -54,8 +55,8 @@
{
auto bus = sdbusplus::bus::new_default();
auto service = getService(bus, pimPath, pimIntf);
- auto pimMsg =
- bus.new_method_call(service.c_str(), pimPath, pimIntf, "Notify");
+ auto pimMsg = bus.new_method_call(service.c_str(), pimPath, pimIntf,
+ "Notify");
pimMsg.append(std::move(objects));
auto result = bus.call(pimMsg);
if (result.is_method_error())
@@ -72,4 +73,4 @@
} // namespace utility
} // namespace common
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/common_utility.hpp b/common_utility.hpp
index 45c2230..5a900b8 100644
--- a/common_utility.hpp
+++ b/common_utility.hpp
@@ -28,4 +28,4 @@
} // namespace utility
} // namespace common
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index b54af12..2c3e144 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -13,16 +13,17 @@
#include <ctype.h>
#include <CLI/CLI.hpp>
-#include <algorithm>
#include <boost/algorithm/string.hpp>
+#include <gpiod.hpp>
+#include <phosphor-logging/log.hpp>
+
+#include <algorithm>
#include <cstdarg>
#include <exception>
#include <filesystem>
#include <fstream>
-#include <gpiod.hpp>
#include <iostream>
#include <iterator>
-#include <phosphor-logging/log.hpp>
#include <regex>
#include <thread>
@@ -356,8 +357,8 @@
if (!rec.empty() && !kw.empty() && vpdMap.count(rec) &&
vpdMap.at(rec).count(kw))
{
- auto encoded =
- encodeKeyword(vpdMap.at(rec).at(kw), encoding);
+ auto encoded = encodeKeyword(vpdMap.at(rec).at(kw),
+ encoding);
props.emplace(busProp, encoded);
}
}
@@ -367,8 +368,8 @@
{
if (auto kwValue = get_if<Binary>(&vpdMap.at(kw)))
{
- auto prop =
- string((*kwValue).begin(), (*kwValue).end());
+ auto prop = string((*kwValue).begin(),
+ (*kwValue).end());
auto encoded = encodeKeyword(prop, encoding);
@@ -377,8 +378,8 @@
else if (auto kwValue =
get_if<std::string>(&vpdMap.at(kw)))
{
- auto prop =
- string((*kwValue).begin(), (*kwValue).end());
+ auto prop = string((*kwValue).begin(),
+ (*kwValue).end());
auto encoded = encodeKeyword(prop, encoding);
@@ -1129,8 +1130,8 @@
{
std::vector<std::string> interfaces = {motherBoardInterface};
// call mapper to check for object path creation
- MapperResponse subTree =
- getObjectSubtreeForInterfaces(pimPath, 0, interfaces);
+ MapperResponse subTree = getObjectSubtreeForInterfaces(pimPath, 0,
+ interfaces);
string mboardPath =
js["frus"][filePath].at(0).value("inventoryPath", "");
@@ -1223,7 +1224,6 @@
if ((isSystemVpd) || (item.value("noprime", false)))
{
-
// Populate one time properties for the system VPD and its sub-frus
// and for other non-primeable frus.
// For the remaining FRUs, this will get handled as a part of
@@ -1595,4 +1595,4 @@
}
return rc;
-}
\ No newline at end of file
+}
diff --git a/ibm_vpd_utils.cpp b/ibm_vpd_utils.cpp
index a085d0e..edb7a9f 100644
--- a/ibm_vpd_utils.cpp
+++ b/ibm_vpd_utils.cpp
@@ -7,18 +7,19 @@
#include "vpd_exceptions.hpp"
#include <boost/algorithm/string.hpp>
-#include <filesystem>
-#include <fstream>
#include <gpiod.hpp>
-#include <iomanip>
#include <nlohmann/json.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
-#include <regex>
#include <sdbusplus/server.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
+
+#include <filesystem>
+#include <fstream>
+#include <iomanip>
+#include <regex>
#include <sstream>
#include <vector>
-#include <xyz/openbmc_project/Common/error.hpp>
using json = nlohmann::json;
@@ -681,15 +682,15 @@
std::string hexString;
std::visit(
[&hexString](auto&& kw) {
- std::stringstream ss;
- std::string hexRep = "0x";
- ss << hexRep;
- for (auto& kwVal : kw)
- {
- ss << std::setfill('0') << std::setw(2) << std::hex
- << static_cast<int>(kwVal);
- }
- hexString = ss.str();
+ std::stringstream ss;
+ std::string hexRep = "0x";
+ ss << hexRep;
+ for (auto& kwVal : kw)
+ {
+ ss << std::setfill('0') << std::setw(2) << std::hex
+ << static_cast<int>(kwVal);
+ }
+ hexString = ss.str();
},
kw);
return hexString;
@@ -700,30 +701,30 @@
std::string kwString{};
std::visit(
[&kwString](auto&& kwVal) {
- const auto it =
- std::find_if(kwVal.begin(), kwVal.end(),
- [](const auto& kw) { return !isprint(kw); });
- if (it != kwVal.end())
+ const auto it =
+ std::find_if(kwVal.begin(), kwVal.end(),
+ [](const auto& kw) { return !isprint(kw); });
+ if (it != kwVal.end())
+ {
+ bool printable = true;
+ for (auto itr = it; itr != kwVal.end(); itr++)
{
- bool printable = true;
- for (auto itr = it; itr != kwVal.end(); itr++)
+ if (*itr != 0x00)
{
- if (*itr != 0x00)
- {
- kwString = hexString(kwVal);
- printable = false;
- break;
- }
- }
- if (printable)
- {
- kwString = std::string(kwVal.begin(), it);
+ kwString = hexString(kwVal);
+ printable = false;
+ break;
}
}
- else
+ if (printable)
{
- kwString = std::string(kwVal.begin(), kwVal.end());
+ kwString = std::string(kwVal.begin(), it);
}
+ }
+ else
+ {
+ kwString = std::string(kwVal.begin(), kwVal.end());
+ }
},
kwVal);
return kwString;
@@ -984,10 +985,10 @@
// TODO: How do we handle multiple chassis?
std::string powerState{};
auto bus = sdbusplus::bus::new_default();
- auto properties =
- bus.new_method_call("xyz.openbmc_project.State.Chassis",
- "/xyz/openbmc_project/state/chassis0",
- "org.freedesktop.DBus.Properties", "Get");
+ auto properties = bus.new_method_call("xyz.openbmc_project.State.Chassis",
+ "/xyz/openbmc_project/state/chassis0",
+ "org.freedesktop.DBus.Properties",
+ "Get");
properties.append("xyz.openbmc_project.State.Chassis");
properties.append("CurrentPowerState");
auto result = bus.call(properties);
@@ -1067,4 +1068,4 @@
}
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/ibm_vpd_utils.hpp b/ibm_vpd_utils.hpp
index ad3fbea..4ebda1e 100644
--- a/ibm_vpd_utils.hpp
+++ b/ibm_vpd_utils.hpp
@@ -4,8 +4,9 @@
#include "store.hpp"
#include "types.hpp"
-#include <iostream>
#include <nlohmann/json.hpp>
+
+#include <iostream>
#include <optional>
#include <variant>
@@ -108,9 +109,9 @@
try
{
auto bus = sdbusplus::bus::new_default();
- auto properties =
- bus.new_method_call(service.c_str(), object.c_str(),
- "org.freedesktop.DBus.Properties", "Get");
+ auto properties = bus.new_method_call(service.c_str(), object.c_str(),
+ "org.freedesktop.DBus.Properties",
+ "Get");
properties.append(inf);
properties.append(prop);
auto result = bus.call(properties);
@@ -447,9 +448,9 @@
try
{
auto bus = sdbusplus::bus::new_default();
- auto method =
- bus.new_method_call(service.c_str(), object.c_str(),
- "org.freedesktop.DBus.Properties", "Set");
+ auto method = bus.new_method_call(service.c_str(), object.c_str(),
+ "org.freedesktop.DBus.Properties",
+ "Set");
method.append(interface);
method.append(propertyName);
method.append(propertyValue);
@@ -501,4 +502,4 @@
std::string getDbusNameForThisKw(const std::string& keyword);
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/impl.cpp b/impl.cpp
index 7d51433..1f1cb9e 100644
--- a/impl.cpp
+++ b/impl.cpp
@@ -1,5 +1,7 @@
#include "impl.hpp"
+#include "vpdecc/vpdecc.h"
+
#include "const.hpp"
#include "defines.hpp"
#include "ibm_vpd_utils.hpp"
@@ -15,8 +17,6 @@
#include <tuple>
#include <unordered_map>
-#include "vpdecc/vpdecc.h"
-
namespace openpower
{
namespace vpd
@@ -348,9 +348,9 @@
if (rc != eccStatus::SUCCESS)
{
- std::string errorMsg =
- std::string("ERROR: ECC check did not pass for the "
- "Record:");
+ std::string errorMsg = std::string(
+ "ERROR: ECC check did not pass for the "
+ "Record:");
throw(VpdEccException(errorMsg));
}
}
@@ -660,4 +660,4 @@
} // namespace parser
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/impl.hpp b/impl.hpp
index 738549a..57a3528 100644
--- a/impl.hpp
+++ b/impl.hpp
@@ -203,4 +203,4 @@
} // namespace parser
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/store.hpp b/store.hpp
index 6cf1a01..b3f30e6 100644
--- a/store.hpp
+++ b/store.hpp
@@ -38,9 +38,7 @@
*
* @param[in] vpdBuffer - A parsed VPD object
*/
- explicit Store(Parsed&& vpdBuffer) : vpd(std::move(vpdBuffer))
- {
- }
+ explicit Store(Parsed&& vpdBuffer) : vpd(std::move(vpdBuffer)) {}
/** @brief Retrieves VPD from Store as a Parsed object
*
@@ -78,13 +76,12 @@
*/
void dump() const
{
- for (auto const& [vpdname, avpd] : vpd)
+ for (const auto& [vpdname, avpd] : vpd)
{
std::cout << vpdname << ": " << std::endl;
- for (auto const& [key, val] : avpd)
+ for (const auto& [key, val] : avpd)
{
-
std::cout << "\t" << key << " : " << val << std::endl;
}
}
diff --git a/test/ipz_parser/parser.cpp b/test/ipz_parser/parser.cpp
index c4c7566..0a36ad7 100644
--- a/test/ipz_parser/parser.cpp
+++ b/test/ipz_parser/parser.cpp
@@ -1,13 +1,14 @@
#include "ipz_parser.hpp"
-#include <cassert>
#include <const.hpp>
#include <defines.hpp>
-#include <fstream>
#include <impl.hpp>
-#include <iterator>
#include <store.hpp>
+#include <cassert>
+#include <fstream>
+#include <iterator>
+
#include <gtest/gtest.h>
using namespace openpower::vpd;
diff --git a/test/keyword_vpd_parser_test/kw_vpd_test.cpp b/test/keyword_vpd_parser_test/kw_vpd_test.cpp
index 413e31b..becdd56 100644
--- a/test/keyword_vpd_parser_test/kw_vpd_test.cpp
+++ b/test/keyword_vpd_parser_test/kw_vpd_test.cpp
@@ -210,4 +210,4 @@
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/test/parser/parser.cpp b/test/parser/parser.cpp
index 57da82f..d9f441e 100644
--- a/test/parser/parser.cpp
+++ b/test/parser/parser.cpp
@@ -1,10 +1,11 @@
-#include <cassert>
#include <defines.hpp>
-#include <fstream>
-#include <iterator>
#include <store.hpp>
#include <vpd-parser/ipz_parser.hpp>
+#include <cassert>
+#include <fstream>
+#include <iterator>
+
void runTests()
{
using namespace openpower::vpd;
diff --git a/test/vpd-manager-test/editor_test.cpp b/test/vpd-manager-test/editor_test.cpp
index b6fcfa8..53f32ad 100644
--- a/test/vpd-manager-test/editor_test.cpp
+++ b/test/vpd-manager-test/editor_test.cpp
@@ -1,8 +1,9 @@
#include "editor_impl.hpp"
#include "ipz_parser.hpp"
-#include <algorithm>
#include <nlohmann/json.hpp>
+
+#include <algorithm>
#include <vector>
#include <gtest/gtest.h>
@@ -176,4 +177,4 @@
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/test/vpd-manager-test/reader_test.cpp b/test/vpd-manager-test/reader_test.cpp
index 58d8d2f..7c1dccf 100644
--- a/test/vpd-manager-test/reader_test.cpp
+++ b/test/vpd-manager-test/reader_test.cpp
@@ -4,8 +4,9 @@
#include "reader_impl.hpp"
#include "types.hpp"
-#include <fstream>
#include <nlohmann/json.hpp>
+
+#include <fstream>
#include <tuple>
#include <gmock/gmock.h>
@@ -151,8 +152,8 @@
MockUtilCalls uCalls;
ReaderImpl read(uCalls);
- ListOfPaths paths =
- read.getFrusAtLocation(LocationCode, nodeNumber, fruLocationCode);
+ ListOfPaths paths = read.getFrusAtLocation(LocationCode, nodeNumber,
+ fruLocationCode);
std::string expected =
"/xyz/openbmc_project/inventory/system/chassis/motherboard";
EXPECT_EQ(paths.at(0), expected);
@@ -167,8 +168,8 @@
ReaderImpl read(uCalls);
ListOfPaths paths;
EXPECT_ANY_THROW({
- paths =
- read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+ paths = read.getFRUsByExpandedLocationCode(locationCode,
+ fruLocationCode);
});
// unused variable warning
@@ -177,8 +178,8 @@
// length is les sthan 17 for expanded location code
locationCode = "U9105.22A.SIMP10";
EXPECT_ANY_THROW({
- paths =
- read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+ paths = read.getFRUsByExpandedLocationCode(locationCode,
+ fruLocationCode);
});
// Invalid location code. No "."
@@ -194,8 +195,8 @@
// unused variable warning
(void)paths;
EXPECT_ANY_THROW({
- paths =
- read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
+ paths = read.getFRUsByExpandedLocationCode(locationCode,
+ fruLocationCode);
});
}
@@ -212,8 +213,8 @@
testing::Return("78DAPQRS")); // return a dummy value for FC keyword
ReaderImpl read(uCalls);
- ListOfPaths paths =
- read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
+ ListOfPaths paths = read.getFRUsByExpandedLocationCode(validLocationCode,
+ fruLocationCode);
std::string expected =
"/xyz/openbmc_project/inventory/system/chassis/motherboard";
@@ -240,8 +241,8 @@
testing::Return("9105PQRS")); // return a dummy value for TM keyword
ReaderImpl read(uCalls);
- ListOfPaths paths =
- read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
+ ListOfPaths paths = read.getFRUsByExpandedLocationCode(validLocationCode,
+ fruLocationCode);
std::string expected = "/xyz/openbmc_project/inventory/system";
EXPECT_EQ(paths.at(0), expected);
@@ -252,4 +253,4 @@
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/types.hpp b/types.hpp
index a98a4f3..dae7207 100644
--- a/types.hpp
+++ b/types.hpp
@@ -1,8 +1,9 @@
#pragma once
+#include <sdbusplus/server.hpp>
+
#include <climits>
#include <map>
-#include <sdbusplus/server.hpp>
#include <string>
#include <unordered_map>
#include <vector>
@@ -82,4 +83,4 @@
} // namespace inventory
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/utilInterface.hpp b/utilInterface.hpp
index 0d13b7d..14c821c 100644
--- a/utilInterface.hpp
+++ b/utilInterface.hpp
@@ -15,9 +15,7 @@
class UtilityInterface
{
public:
- virtual ~UtilityInterface()
- {
- }
+ virtual ~UtilityInterface() {}
virtual std::string readBusProperty(const std::string& obj,
const std::string& inf,
@@ -27,9 +25,7 @@
class utility : public UtilityInterface
{
public:
- virtual ~utility()
- {
- }
+ virtual ~utility() {}
std::string readBusProperty(const std::string& obj, const std::string& inf,
const std::string& prop) override
diff --git a/vpd-manager/bios_handler.cpp b/vpd-manager/bios_handler.cpp
index d4a5330..1130cd5 100644
--- a/vpd-manager/bios_handler.cpp
+++ b/vpd-manager/bios_handler.cpp
@@ -7,9 +7,10 @@
#include "manager.hpp"
#include "types.hpp"
+#include <sdbusplus/bus.hpp>
+
#include <iostream>
#include <memory>
-#include <sdbusplus/bus.hpp>
#include <string>
#include <tuple>
#include <variant>
@@ -33,23 +34,22 @@
sdbusplus::bus::match::rules::nameOwnerChanged(
"xyz.openbmc_project.PLDM"),
[this](sdbusplus::message_t& msg) {
- if (msg.is_method_error())
- {
- std::cerr << "Error in reading name owner signal "
- << std::endl;
- return;
- }
- std::string name;
- std::string newOwner;
- std::string oldOwner;
+ if (msg.is_method_error())
+ {
+ std::cerr << "Error in reading name owner signal " << std::endl;
+ return;
+ }
+ std::string name;
+ std::string newOwner;
+ std::string oldOwner;
- msg.read(name, oldOwner, newOwner);
- if (newOwner != "" && name == "xyz.openbmc_project.PLDM")
- {
- this->restoreBIOSAttribs();
- // We don't need the match anymore
- nameOwnerMatch.reset();
- }
+ msg.read(name, oldOwner, newOwner);
+ if (newOwner != "" && name == "xyz.openbmc_project.PLDM")
+ {
+ this->restoreBIOSAttribs();
+ // We don't need the match anymore
+ nameOwnerMatch.reset();
+ }
});
// Check if PLDM is already running, if it is, we can go ahead and attempt
// to sync BIOS attributes (since PLDM would have initialized them by the
@@ -550,8 +550,8 @@
}
// Need to write?
- std::string toWrite =
- (createDefaultLpar.at(0) & 0x02) ? "Enabled" : "Disabled";
+ std::string toWrite = (createDefaultLpar.at(0) & 0x02) ? "Enabled"
+ : "Disabled";
if (createDefaultLparInBIOS == toWrite)
{
std::cout << "Skip Create default LPAR BIOS write, value is already: "
@@ -623,8 +623,8 @@
// VPD keywords with data taken from the BIOS.
auto fcoInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "RG");
auto ammInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D0");
- auto keepAndClearInVPD =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
+ auto keepAndClearInVPD = readBusProperty(SYSTEM_OBJECT,
+ "com.ibm.ipzvpd.UTIL", "D1");
auto fcoInBIOS = readBIOSFCO();
auto ammInBIOS = readBIOSAMM();
auto keepAndClearInBIOS = readBIOSKeepAndClear();
@@ -655,13 +655,13 @@
saveKeepAndClearToBIOS(keepAndClearInVPD, keepAndClearInBIOS);
// Have to read D1 again because two attributes are stored in the same
// keyword.
- auto createDefaultLparInVPD =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
+ auto createDefaultLparInVPD = readBusProperty(SYSTEM_OBJECT,
+ "com.ibm.ipzvpd.UTIL", "D1");
saveCreateDefaultLparToBIOS(createDefaultLparInVPD,
createDefaultLparInBIOS);
- auto clearNVRAMInVPD =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
+ auto clearNVRAMInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL",
+ "D1");
saveClearNVRAMToBIOS(clearNVRAMInVPD, clearNVRAMInBIOS);
// Start listener now that we have done the restore
@@ -669,4 +669,4 @@
}
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/bios_handler.hpp b/vpd-manager/bios_handler.hpp
index dda120c..ef4cfa4 100644
--- a/vpd-manager/bios_handler.hpp
+++ b/vpd-manager/bios_handler.hpp
@@ -5,6 +5,7 @@
#include <stdint.h>
#include <sdbusplus/asio/connection.hpp>
+
#include <string>
namespace openpower
@@ -252,4 +253,4 @@
}; // class BiosHandler
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/editor_impl.cpp b/vpd-manager/editor_impl.cpp
index f95f4cf..f0cfa2d 100644
--- a/vpd-manager/editor_impl.cpp
+++ b/vpd-manager/editor_impl.cpp
@@ -2,6 +2,8 @@
#include "editor_impl.hpp"
+#include "vpdecc/vpdecc.h"
+
#include "common_utility.hpp"
#include "ibm_vpd_utils.hpp"
#include "ipz_parser.hpp"
@@ -11,8 +13,6 @@
#include <phosphor-logging/elog-errors.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
-#include "vpdecc/vpdecc.h"
-
using namespace openpower::vpd::parser::interface;
using namespace openpower::vpd::constants;
using namespace openpower::vpd::parser::factory;
@@ -470,17 +470,17 @@
if (locationCodeType == "fcs")
{
- propertyFCorTM =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "FC");
- propertySE =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "SE");
+ propertyFCorTM = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN",
+ "FC");
+ propertySE = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN",
+ "SE");
}
else if (locationCodeType == "mts")
{
- propertyFCorTM =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "TM");
- propertySE =
- readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "SE");
+ propertyFCorTM = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
+ "TM");
+ propertySE = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
+ "SE");
}
const nlohmann::json& groupFRUS =
@@ -711,4 +711,4 @@
} // namespace editor
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/editor_impl.hpp b/vpd-manager/editor_impl.hpp
index 5beedba..3253332 100644
--- a/vpd-manager/editor_impl.hpp
+++ b/vpd-manager/editor_impl.hpp
@@ -3,9 +3,10 @@
#include "const.hpp"
#include "types.hpp"
+#include <nlohmann/json.hpp>
+
#include <cstddef>
#include <fstream>
-#include <nlohmann/json.hpp>
#include <tuple>
namespace openpower
@@ -26,9 +27,7 @@
EditorImpl& operator=(const EditorImpl&) = delete;
EditorImpl(EditorImpl&&) = delete;
EditorImpl& operator=(EditorImpl&&) = delete;
- ~EditorImpl()
- {
- }
+ ~EditorImpl() {}
/** @brief Construct EditorImpl class
*
@@ -40,8 +39,7 @@
Binary&& vpd) :
startOffset(0),
thisRecord(record, kwd), vpdFile(std::move(vpd))
- {
- }
+ {}
/** @brief Construct EditorImpl class
*
@@ -57,8 +55,7 @@
vpdFilePath(path),
objPath(inventoryPath), startOffset(0), jsonFile(json),
thisRecord(record, kwd)
- {
- }
+ {}
/** @brief Construct EditorImpl class
*
@@ -71,8 +68,7 @@
const std::string& record, const std::string& kwd) :
vpdFilePath(path),
jsonFile(json), thisRecord(record, kwd)
- {
- }
+ {}
/**
* @brief Update data for keyword
@@ -208,8 +204,7 @@
RecInfo(const std::string& rec, const std::string& kwd) :
recName(rec), recKWd(kwd), recOffset(0), recECCoffset(0),
recECCLength(0), kwdDataLength(0), recSize(0), kwDataOffset(0)
- {
- }
+ {}
} thisRecord;
Binary vpdFile;
@@ -221,4 +216,4 @@
} // namespace editor
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/gpioMonitor.cpp b/vpd-manager/gpioMonitor.cpp
index 1affa62..90374d2 100644
--- a/vpd-manager/gpioMonitor.cpp
+++ b/vpd-manager/gpioMonitor.cpp
@@ -198,4 +198,4 @@
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/gpioMonitor.hpp b/vpd-manager/gpioMonitor.hpp
index 58fbf91..078902a 100644
--- a/vpd-manager/gpioMonitor.hpp
+++ b/vpd-manager/gpioMonitor.hpp
@@ -142,4 +142,4 @@
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 5fc415e..50c4b90 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -10,10 +10,11 @@
#include "reader_impl.hpp"
#include "vpd_exceptions.hpp"
-#include <filesystem>
#include <phosphor-logging/elog-errors.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
+#include <filesystem>
+
using namespace openpower::vpd::constants;
using namespace openpower::vpd::inventory;
using namespace openpower::vpd::manager::editor;
@@ -42,7 +43,7 @@
[this](const sdbusplus::message::object_path& path,
const std::string& recordName, const std::string& keyword,
const Binary& value) {
- this->writeKeyword(path, recordName, keyword, value);
+ this->writeKeyword(path, recordName, keyword, value);
});
interface->register_method(
@@ -786,4 +787,4 @@
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-manager/manager.hpp b/vpd-manager/manager.hpp
index a0a9ca6..f8b7cbc 100644
--- a/vpd-manager/manager.hpp
+++ b/vpd-manager/manager.hpp
@@ -4,9 +4,10 @@
#include "editor_impl.hpp"
#include "gpioMonitor.hpp"
-#include <map>
#include <sdbusplus/asio/object_server.hpp>
+#include <map>
+
namespace openpower
{
namespace vpd
diff --git a/vpd-manager/reader_impl.cpp b/vpd-manager/reader_impl.cpp
index b1f16b1..92f6a91 100644
--- a/vpd-manager/reader_impl.cpp
+++ b/vpd-manager/reader_impl.cpp
@@ -4,13 +4,14 @@
#include "ibm_vpd_utils.hpp"
-#include <algorithm>
#include <com/ibm/VPD/error.hpp>
-#include <map>
#include <phosphor-logging/elog-errors.hpp>
-#include <vector>
#include <xyz/openbmc_project/Common/error.hpp>
+#include <algorithm>
+#include <map>
+#include <vector>
+
#ifdef ManagerTest
#include "reader_test.hpp"
#endif
@@ -112,8 +113,8 @@
for_each(range.first, range.second,
[&inventoryPaths](
const inventory::LocationCodeMap::value_type& mappedItem) {
- inventoryPaths.push_back(INVENTORY_PATH + mappedItem.second);
- });
+ inventoryPaths.push_back(INVENTORY_PATH + mappedItem.second);
+ });
return inventoryPaths;
}
@@ -188,8 +189,8 @@
{
std::string tm{};
// read TM kwd value
- tm =
- utilObj.readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "TM");
+ tm = utilObj.readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
+ "TM");
;
// check if the substr matches to TM kwd
diff --git a/vpd-manager/reader_impl.hpp b/vpd-manager/reader_impl.hpp
index 4de3c9b..7525a4f 100644
--- a/vpd-manager/reader_impl.hpp
+++ b/vpd-manager/reader_impl.hpp
@@ -28,9 +28,7 @@
~ReaderImpl() = default;
#ifdef ManagerTest
- explicit ReaderImpl(IUtil& obj) : utilObj(obj)
- {
- }
+ explicit ReaderImpl(IUtil& obj) : utilObj(obj) {}
#endif
/** @brief An API to expand a given unexpanded location code.
diff --git a/vpd-parser/ipz_parser.cpp b/vpd-parser/ipz_parser.cpp
index d923aa6..bb4ee2f 100644
--- a/vpd-parser/ipz_parser.cpp
+++ b/vpd-parser/ipz_parser.cpp
@@ -34,4 +34,4 @@
} // namespace parser
} // namespace ipz
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-parser/ipz_parser.hpp b/vpd-parser/ipz_parser.hpp
index e431cd3..1b1f034 100644
--- a/vpd-parser/ipz_parser.hpp
+++ b/vpd-parser/ipz_parser.hpp
@@ -41,8 +41,7 @@
vpd(VpdVector),
inventoryPath(path), vpdFilePath(vpdFilePath),
vpdStartOffset(vpdStartOffset)
- {
- }
+ {}
/**
* @brief Parse the memory VPD binary data.
diff --git a/vpd-parser/isdimm_vpd_parser.cpp b/vpd-parser/isdimm_vpd_parser.cpp
index 334a2a3..7071516 100644
--- a/vpd-parser/isdimm_vpd_parser.cpp
+++ b/vpd-parser/isdimm_vpd_parser.cpp
@@ -132,7 +132,6 @@
auto isdimmVpdParser::getDDR4PartNumber(Binary::const_iterator& iterator)
{
-
char tmpPN[constants::PART_NUM_LEN + 1] = {'\0'};
sprintf(tmpPN, "%02X%02X%02X%X",
iterator[SPD_JEDEC_DDR4_SDRAM_DENSITY_BANK_OFFSET],
diff --git a/vpd-parser/isdimm_vpd_parser.hpp b/vpd-parser/isdimm_vpd_parser.hpp
index 9d6cca8..69ae2c5 100644
--- a/vpd-parser/isdimm_vpd_parser.hpp
+++ b/vpd-parser/isdimm_vpd_parser.hpp
@@ -30,9 +30,7 @@
*
* Move memVpdVector to parser object's memVpdVector
*/
- isdimmVpdParser(const Binary& VpdVector) : memVpd(VpdVector)
- {
- }
+ isdimmVpdParser(const Binary& VpdVector) : memVpd(VpdVector) {}
/**
* @brief Parse the memory SPD binary data.
diff --git a/vpd-parser/keyword_vpd_parser.cpp b/vpd-parser/keyword_vpd_parser.cpp
index 1d100a8..ca05692 100644
--- a/vpd-parser/keyword_vpd_parser.cpp
+++ b/vpd-parser/keyword_vpd_parser.cpp
@@ -199,7 +199,6 @@
void KeywordVpdParser::itrOutOfBoundCheck(uint8_t incVar)
{
-
if ((std::distance(keywordVpdVector.begin(), kwVpdIterator + incVar)) >
std::distance(keywordVpdVector.begin(), keywordVpdVector.end()))
{
diff --git a/vpd-parser/keyword_vpd_parser.hpp b/vpd-parser/keyword_vpd_parser.hpp
index e48e7d5..4466c6b 100644
--- a/vpd-parser/keyword_vpd_parser.hpp
+++ b/vpd-parser/keyword_vpd_parser.hpp
@@ -51,8 +51,7 @@
*/
KeywordVpdParser(const openpower::vpd::Binary& kwVpdVector) :
keywordVpdVector(kwVpdVector)
- {
- }
+ {}
/**
* @brief Parse the keyword VPD binary data.
@@ -74,13 +73,13 @@
private:
openpower::vpd::Binary::const_iterator
- checkSumStart; //!< Pointer to the start byte from where
- //!< the checksum need to be calculated
+ checkSumStart; //!< Pointer to the start byte from where
+ //!< the checksum need to be calculated
openpower::vpd::Binary::const_iterator
- checkSumEnd; //!< Pointer to the end byte until which the
- //!< checksum need to be calculated
+ checkSumEnd; //!< Pointer to the end byte until which the
+ //!< checksum need to be calculated
openpower::vpd::Binary::const_iterator
- kwVpdIterator; //!< Iterator to parse the vector
+ kwVpdIterator; //!< Iterator to parse the vector
const openpower::vpd::Binary&
keywordVpdVector; //!< Vector which stores keyword VPD data
diff --git a/vpd-parser/memory_vpd_parser.cpp b/vpd-parser/memory_vpd_parser.cpp
index 1ce495c..eb07bff 100644
--- a/vpd-parser/memory_vpd_parser.cpp
+++ b/vpd-parser/memory_vpd_parser.cpp
@@ -151,4 +151,4 @@
} // namespace parser
} // namespace memory
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-parser/memory_vpd_parser.hpp b/vpd-parser/memory_vpd_parser.hpp
index cbd44bb..21a45b9 100644
--- a/vpd-parser/memory_vpd_parser.hpp
+++ b/vpd-parser/memory_vpd_parser.hpp
@@ -30,9 +30,7 @@
*
* Move memVpdVector to parser object's memVpdVector
*/
- memoryVpdParser(const Binary& VpdVector) : memVpd(VpdVector)
- {
- }
+ memoryVpdParser(const Binary& VpdVector) : memVpd(VpdVector) {}
/**
* @brief Parse the memory VPD binary data.
@@ -72,4 +70,4 @@
} // namespace parser
} // namespace memory
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-parser/parser_factory.hpp b/vpd-parser/parser_factory.hpp
index 983b8fd..ca9f41e 100644
--- a/vpd-parser/parser_factory.hpp
+++ b/vpd-parser/parser_factory.hpp
@@ -49,4 +49,4 @@
} // namespace factory
} // namespace parser
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd-parser/parser_interface.hpp b/vpd-parser/parser_interface.hpp
index 2f11aff..4ad583f 100644
--- a/vpd-parser/parser_interface.hpp
+++ b/vpd-parser/parser_interface.hpp
@@ -49,9 +49,7 @@
/**
* @brief Virtual destructor for the interface.
*/
- virtual ~ParserInterface()
- {
- }
+ virtual ~ParserInterface() {}
}; // class Parserinterface
} // namespace interface
diff --git a/vpd_exceptions.hpp b/vpd_exceptions.hpp
index f3473e5..bcfd366 100644
--- a/vpd_exceptions.hpp
+++ b/vpd_exceptions.hpp
@@ -32,8 +32,7 @@
*/
explicit VPDException(const std::string& msg) :
std::runtime_error(msg), errMsg(msg)
- {
- }
+ {}
/** @brief inline method to return exception string
* This is overridden method of std::runtime class
@@ -68,9 +67,7 @@
/** @brief constructor
* @param[in] - string to define exception
*/
- explicit VpdEccException(const std::string& msg) : VPDException(msg)
- {
- }
+ explicit VpdEccException(const std::string& msg) : VPDException(msg) {}
}; // class VpdEccException
@@ -93,9 +90,7 @@
/** @brief constructor
* @param[in] - string to define exception
*/
- explicit VpdDataException(const std::string& msg) : VPDException(msg)
- {
- }
+ explicit VpdDataException(const std::string& msg) : VPDException(msg) {}
}; // class VpdDataException
@@ -117,8 +112,7 @@
*/
VpdJsonException(const std::string& msg, const std::string& path) :
VPDException(msg), jsonPath(path)
- {
- }
+ {}
/** @brief Json path getter method.
* @return - Json path
@@ -153,11 +147,9 @@
/** @brief constructor
* @param[in] msg - string to define exception
*/
- explicit GpioException(const std::string& msg) : VPDException(msg)
- {
- }
+ explicit GpioException(const std::string& msg) : VPDException(msg) {}
};
} // namespace exceptions
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower
diff --git a/vpd_tool.cpp b/vpd_tool.cpp
index bc5e37e..0f27f52 100644
--- a/vpd_tool.cpp
+++ b/vpd_tool.cpp
@@ -1,6 +1,7 @@
#include "vpd_tool_impl.hpp"
#include <CLI/CLI.hpp>
+
#include <filesystem>
#include <fstream>
#include <iostream>
@@ -23,10 +24,10 @@
string val{};
uint32_t offset = 0;
- auto object =
- app.add_option("--object, -O", objectPath, "Enter the Object Path");
- auto record =
- app.add_option("--record, -R", recordName, "Enter the Record Name");
+ auto object = app.add_option("--object, -O", objectPath,
+ "Enter the Object Path");
+ auto record = app.add_option("--record, -R", recordName,
+ "Enter the Record Name");
auto kw = app.add_option("--keyword, -K", keyword, "Enter the Keyword");
auto valOption = app.add_option(
"--value, -V", val,
@@ -91,9 +92,9 @@
"--fixSystemVPD", "Use this option to interactively fix critical "
"system VPD keywords {vpd-tool-exe --fixSystemVPD}");
- auto mfgClean =
- app.add_flag("--mfgClean", "Flag to clean and reset specific keywords "
- "on system VPD to its default value.");
+ auto mfgClean = app.add_flag("--mfgClean",
+ "Flag to clean and reset specific keywords "
+ "on system VPD to its default value.");
auto confirm =
app.add_flag("--yes", "Using this flag with --mfgClean option, assumes "
@@ -241,4 +242,4 @@
}
return rc;
-}
\ No newline at end of file
+}
diff --git a/vpd_tool_impl.cpp b/vpd_tool_impl.cpp
index 5870659..ca95c2a 100644
--- a/vpd_tool_impl.cpp
+++ b/vpd_tool_impl.cpp
@@ -4,10 +4,11 @@
#include "parser_factory.hpp"
#include "vpd_exceptions.hpp"
+#include <sdbusplus/bus.hpp>
+
#include <cstdlib>
#include <filesystem>
#include <iostream>
-#include <sdbusplus/bus.hpp>
#include <variant>
#include <vector>
@@ -128,8 +129,8 @@
}
else
{
- std::string err =
- vpdPath + " is not of type IPZ VPD. Unable to parse the VPD.";
+ std::string err = vpdPath +
+ " is not of type IPZ VPD. Unable to parse the VPD.";
throw std::runtime_error(err);
}
}
@@ -540,8 +541,8 @@
}
auto bus = sdbusplus::bus::new_default();
- auto properties =
- bus.new_method_call(BUSNAME, OBJPATH, IFACE, "WriteKeyword");
+ auto properties = bus.new_method_call(BUSNAME, OBJPATH, IFACE,
+ "WriteKeyword");
properties.append(static_cast<sdbusplus::message::object_path>(fruPath));
properties.append(recordName);
properties.append(keyword);
@@ -584,8 +585,7 @@
}
}
catch (const fs::filesystem_error& e)
- {
- }
+ {}
}
}
@@ -1146,4 +1146,4 @@
<< "\nManufacturing reset on system vpd keywords is unsuccessful";
}
return 0;
-}
\ No newline at end of file
+}
diff --git a/vpd_tool_impl.hpp b/vpd_tool_impl.hpp
index 82a1b8c..11e6ef8 100644
--- a/vpd_tool_impl.hpp
+++ b/vpd_tool_impl.hpp
@@ -5,6 +5,7 @@
#include "types.hpp"
#include <nlohmann/json.hpp>
+
#include <string>
using json = nlohmann::json;
@@ -283,18 +284,14 @@
* object instantiation for dumpInventory option and
* forceReset option.
*/
- VpdTool()
- {
- }
+ VpdTool() {}
/**
* @brief Constructor
* Constructor is called during the
* object instantiation for dumpObject option.
*/
- VpdTool(const std::string&& fru) : fruPath(std::move(fru))
- {
- }
+ VpdTool(const std::string&& fru) : fruPath(std::move(fru)) {}
/**
* @brief Constructor
@@ -307,6 +304,5 @@
fruPath(std::move(fru)),
recordName(std::move(recName)), keyword(std::move(kw)),
value(std::move(val))
- {
- }
-};
\ No newline at end of file
+ {}
+};
diff --git a/vpdecc/vpdecc.h b/vpdecc/vpdecc.h
index 6d4175d..bf8bc0e 100644
--- a/vpdecc/vpdecc.h
+++ b/vpdecc/vpdecc.h
@@ -1,90 +1,99 @@
-/******************************************************************************
- *
- * IBM Confidential
- *
- * Licensed Internal Code Source Materials
- *
- * IBM Flexible Support Processor Licensed Internal Code
- *
- * (c) Copyright IBM Corp. 2004
- *
- * The source code is for this program is not published or otherwise divested
- * of its trade secrets, irrespective of what has been deposited with the
- * U.S. Copyright Office.
- *
- *****************************************************************************/
-
-#ifndef _VPDECC_H_
-#define _VPDECC_H_
-
-#pragma GCC diagnostic ignored "-Wunused-variable"
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-
-#include <stdlib.h>
-
-#define VPD_ECC_OK 0
-#define VPD_ECC_NOT_ENOUGH_BUFFER 1
-#define VPD_ECC_WRONG_ECC_SIZE 2
-#define VPD_ECC_WRONG_BUFFER_SIZE 9
-#define VPD_ECC_UNCORRECTABLE_DATA 90
-#define VPD_ECC_CORRECTABLE_DATA 91
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* TODO doxygen !!!!!!!! */
-
-/******************************************************************************/
-/* vpdecc_create_ecc */
-/* */
-/* For a given data block (together with the length of the data block */
-/* this function creates the ECC */
-/* */
-/* @param pData In-Buffer containing the raw VPD data */
-/* (wont't be changed) */
-/* */
-/* @param vDataLength In should contain the length of the Data */
-/* in the buffer given to vData */
-/* */
-/* @param pEcc Out-Buffer after execution this will be the */
-/* buffer for the calculated Ecc */
-/* */
-/* @param pEccLenght In/Out In : size of buffer */
-/* Out: contains the length of the Ecc */
-/* */
-/* @return Error returncode */
-/******************************************************************************/
-int vpdecc_create_ecc(const unsigned char* data, size_t datalength,
- unsigned char* ecc, size_t* ecc_buffersize);
-
-/******************************************************************************/
-/* vpdecc_check_data */
-/* */
-/* For a given data block (together with the ecc) */
-/* this function checks the data for validness */
-/* */
-/* @param pData In-Buffer containing the raw VPD data */
-/* Out-Buffer containing the raw VPD data */
-/* No error : data unchanged */
-/* Correctable error : data corrected */
-/* Uncorrectable error: data unchanged */
-/* */
-/* @param vDataLength In should contain the length of the Data */
-/* in the buffer given to vData */
-/* */
-/* @param pEcc In-Buffer should contain the Ecc for the data */
-/* */
-/* */
-/* @param vEccLenght In should contain the length of the Ecc */
-/* */
-/* @return Error returncode */
-/******************************************************************************/
-int vpdecc_check_data(unsigned char* data, size_t data_length,
- const unsigned char* ecc, size_t ecc_length);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-#endif /* endif _VPDECC_H_ */
+/******************************************************************************
+ *
+ * IBM Confidential
+ *
+ * Licensed Internal Code Source Materials
+ *
+ * IBM Flexible Support Processor Licensed Internal Code
+ *
+ * (c) Copyright IBM Corp. 2004
+ *
+ * The source code is for this program is not published or otherwise divested
+ * of its trade secrets, irrespective of what has been deposited with the
+ * U.S. Copyright Office.
+ *
+ *****************************************************************************/
+
+#ifndef _VPDECC_H_
+#define _VPDECC_H_
+
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+
+#include <stdlib.h>
+
+#define VPD_ECC_OK 0
+#define VPD_ECC_NOT_ENOUGH_BUFFER 1
+#define VPD_ECC_WRONG_ECC_SIZE 2
+#define VPD_ECC_WRONG_BUFFER_SIZE 9
+#define VPD_ECC_UNCORRECTABLE_DATA 90
+#define VPD_ECC_CORRECTABLE_DATA 91
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /* TODO doxygen !!!!!!!! */
+
+ /******************************************************************************/
+ /* vpdecc_create_ecc */
+ /* */
+ /* For a given data block (together with the length of the data block */
+ /* this function creates the ECC */
+ /* */
+ /* @param pData In-Buffer containing the raw VPD data */
+ /* (wont't be changed) */
+ /* */
+ /* @param vDataLength In should contain the length of the
+ * Data */
+ /* in the buffer given to vData */
+ /* */
+ /* @param pEcc Out-Buffer after execution this will be the */
+ /* buffer for the calculated Ecc */
+ /* */
+ /* @param pEccLenght In/Out In : size of buffer */
+ /* Out: contains the length of the Ecc
+ */
+ /* */
+ /* @return Error returncode */
+ /******************************************************************************/
+ int vpdecc_create_ecc(const unsigned char* data, size_t datalength,
+ unsigned char* ecc, size_t* ecc_buffersize);
+
+ /******************************************************************************/
+ /* vpdecc_check_data */
+ /* */
+ /* For a given data block (together with the ecc) */
+ /* this function checks the data for validness */
+ /* */
+ /* @param pData In-Buffer containing the raw VPD data */
+ /* Out-Buffer containing the raw VPD data */
+ /* No error : data unchanged
+ */
+ /* Correctable error : data corrected
+ */
+ /* Uncorrectable error: data unchanged
+ */
+ /* */
+ /* @param vDataLength In should contain the length of the
+ * Data */
+ /* in the buffer given to vData */
+ /* */
+ /* @param pEcc In-Buffer should contain the Ecc for the data
+ */
+ /* */
+ /* */
+ /* @param vEccLenght In should contain the length of the Ecc
+ */
+ /* */
+ /* @return Error returncode */
+ /******************************************************************************/
+ int vpdecc_check_data(unsigned char* data, size_t data_length,
+ const unsigned char* ecc, size_t ecc_length);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif /* endif _VPDECC_H_ */
diff --git a/vpdecc/vpdecc_support.c b/vpdecc/vpdecc_support.c
index 674f236..c6bc1c3 100644
--- a/vpdecc/vpdecc_support.c
+++ b/vpdecc/vpdecc_support.c
@@ -46,8 +46,7 @@
const unsigned char syndrom,
const unsigned char* csdSyndroms,
unsigned char* vResult)
-{
-}
+{}
/******************************************************************************/
/* seepromGenerateCheckSyndromDecode */
@@ -57,8 +56,7 @@
void seepromGenerateCheckSyndromDecode(const unsigned char checkSyndrom,
unsigned char* csdData,
unsigned char* csdEcc)
-{
-}
+{}
/******************************************************************************/
/* seepromEccCheck */
diff --git a/write.hpp b/write.hpp
index 0544bdf..ac1b148 100644
--- a/write.hpp
+++ b/write.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <store.hpp>
+
#include <string>
namespace openpower