mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
smaller code-style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
parent
3b8949afe9
commit
c2437b51cf
4 changed files with 14 additions and 10 deletions
|
@ -52,11 +52,11 @@ PCIeCardFactory::make(json_t *json, std::shared_ptr<kernel::pci::DeviceList> 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<kernel::pci::DeviceList> 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");
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ void BramFactory::parse(Core &ip, json_t* cfg)
|
|||
auto &bram = dynamic_cast<Bram&>(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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue