diff options
| author | Patrick Venture <venture@google.com> | 2019-07-26 08:28:36 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2019-07-26 08:30:46 -0700 |
| commit | e3feacfa00823773ca5db363ffeb1d537f52e9a9 (patch) | |
| tree | e4bd5ff42912e5fab1c27ec1e0874a21599455a4 | |
| parent | 1871fe94afce02af08ef06e5c452784ff2f052c2 (diff) | |
| download | phosphor-ipmi-flash-e3feacfa00823773ca5db363ffeb1d537f52e9a9.tar.gz phosphor-ipmi-flash-e3feacfa00823773ca5db363ffeb1d537f52e9a9.zip | |
bugfix: tools: p2a: read returns bool
The read method returns bool, therefore if this returns 0, it's false,
and therefore the read failed.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I365f9edf49a79ca5ea3c13090d6b8a11b9598e53
| -rw-r--r-- | tools/p2a.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/p2a.cpp b/tools/p2a.cpp index 0ac5eb3..b5fa8a4 100644 --- a/tools/p2a.cpp +++ b/tools/p2a.cpp @@ -73,11 +73,14 @@ bool P2aDataHandler::sendContents(const std::string& input, std::uint32_t value; if (!io->read(bar1 | aspeedP2aConfig, sizeof(value), &value)) { - if (0 == (value & p2ABridgeEnabled)) - { - std::fprintf(stderr, "Bridge not enabled.\n"); - return false; - } + std::fprintf(stderr, "PCI config read failed\n"); + return false; + } + + if (0 == (value & p2ABridgeEnabled)) + { + std::fprintf(stderr, "Bridge not enabled.\n"); + return false; } std::fprintf(stderr, "The bridge is enabled!\n"); |

