Fixes an number of coverity issues associated with the iio-bw feature.
Type: fix
Fixes:
e15c999c3
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9ad2b336694132545d90a3483200a510226e9198
- * Copyright (c) 2020 Cisco and/or its affiliates.
+ * Copyright (c) 2021 Intel and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
uword *pu = hash_get (h, root_bus.bus);
e = pool_elt_at_index (p, (index_t) pu[0]);
uword *pu = hash_get (h, root_bus.bus);
e = pool_elt_at_index (p, (index_t) pu[0]);
s = format (s, "IIO%u/%u", e->socket_id, e->iio_unit_id);
return s;
s = format (s, "IIO%u/%u", e->socket_id, e->iio_unit_id);
return s;
{
u8 *rel_path = 0, *abs_path = 0, *link_path = 0;
unformat_input_t input;
{
u8 *rel_path = 0, *abs_path = 0, *link_path = 0;
unformat_input_t input;
- u32 fd = open (sysfs_pci_dev_path, O_RDONLY);
+ int fd = open (sysfs_pci_dev_path, O_RDONLY);
u32 size = 0;
u32 domain = 0, bus;
clib_error_t *err = NULL;
u32 size = 0;
u32 domain = 0, bus;
clib_error_t *err = NULL;
if (!r)
return format (s, "unknown");
if (!r)
return format (s, "unknown");
- return format (s, "P%d", r->link_status >> 24);
+ return format (s, "P%d", r->link_capabilities >> 24);