From c2437b51cf5be4dfeb92437c20f46c3104650610 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 11 Nov 2022 06:53:00 -0500 Subject: [PATCH] smaller code-style fixes Signed-off-by: Steffen Vogel --- fpga/lib/card.cpp | 14 +++++++------- fpga/lib/core.cpp | 4 +++- fpga/lib/ips/bram.cpp | 2 +- fpga/lib/ips/pcie.cpp | 4 +++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/fpga/lib/card.cpp b/fpga/lib/card.cpp index 769941ce3..d7f5ea13c 100644 --- a/fpga/lib/card.cpp +++ b/fpga/lib/card.cpp @@ -52,11 +52,11 @@ PCIeCardFactory::make(json_t *json, std::shared_ptr pci json_object_foreach(json, card_name, json_card) { logger->info("Found config for FPGA card {}", card_name); - json_t* json_ips = nullptr; - const char* pci_slot = nullptr; - const char* pci_id = nullptr; - int do_reset = 0; - int affinity = 0; + json_t *json_ips; + const char *pci_slot = nullptr; + const char *pci_id = nullptr; + int do_reset = 0; + int affinity = 0; json_error_t err; int ret = json_unpack_ex(json_card, &err, 0, "{ s: o, s?: i, s?: b, s?: s, s?: s }", @@ -64,8 +64,8 @@ PCIeCardFactory::make(json_t *json, std::shared_ptr pci "affinity", &affinity, "do_reset", &do_reset, "slot", &pci_slot, - "id", &pci_id); - + "id", &pci_id + ); if (ret != 0) throw ConfigError(json_card, err, "", "Failed to parse card"); diff --git a/fpga/lib/core.cpp b/fpga/lib/core.cpp index 8bddb6564..87309b1b3 100644 --- a/fpga/lib/core.cpp +++ b/fpga/lib/core.cpp @@ -69,7 +69,9 @@ CoreFactory::make(PCIeCard* card, json_t *json_ips) const char* vlnv; json_error_t err; - int ret = json_unpack_ex(json_ip, &err, 0, "{ s: s }", "vlnv", &vlnv); + int ret = json_unpack_ex(json_ip, &err, 0, "{ s: s }", + "vlnv", &vlnv + ); if (ret != 0) throw ConfigError(json_ip, err, "", "IP {} has no VLNV", ipName); diff --git a/fpga/lib/ips/bram.cpp b/fpga/lib/ips/bram.cpp index 15b44b2b3..e1ac43c80 100644 --- a/fpga/lib/ips/bram.cpp +++ b/fpga/lib/ips/bram.cpp @@ -34,7 +34,7 @@ void BramFactory::parse(Core &ip, json_t* cfg) auto &bram = dynamic_cast(ip); json_error_t err; - auto ret = json_unpack_ex(cfg, &err, 0, "{ s: i }", + int ret = json_unpack_ex(cfg, &err, 0, "{ s: i }", "size", &bram.size ); if (ret != 0) diff --git a/fpga/lib/ips/pcie.cpp b/fpga/lib/ips/pcie.cpp index 2881ad50a..383bdaafd 100644 --- a/fpga/lib/ips/pcie.cpp +++ b/fpga/lib/ips/pcie.cpp @@ -134,7 +134,9 @@ AxiPciExpressBridgeFactory::parse(Core &ip, json_t *cfg) unsigned int translation; json_error_t err; - int ret = json_unpack_ex(json_bar, &err, 0, "{ s: i }", "translation", &translation); + int ret = json_unpack_ex(json_bar, &err, 0, "{ s: i }", + "translation", &translation + ); if (ret != 0) throw ConfigError(json_bar, err, "", "Cannot parse {}/{}", barType, bar_name);