aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-01-08 09:33:36 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-04 08:07:26 -0600
commit107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 (patch)
treefdeaad56030a02948377c45838dab97beb7a5c84 /host/lib/usrp/mpmd
parent7d5e48032baa62cbe7467833b9e057900602f4b9 (diff)
downloaduhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.gz
uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.bz2
uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.zip
host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
Diffstat (limited to 'host/lib/usrp/mpmd')
-rw-r--r--host/lib/usrp/mpmd/mpmd_find.cpp2
-rw-r--r--host/lib/usrp/mpmd/mpmd_impl.hpp4
-rw-r--r--host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp12
-rw-r--r--host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp10
-rw-r--r--host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp10
-rw-r--r--host/lib/usrp/mpmd/mpmd_mb_iface.hpp26
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp2
-rw-r--r--host/lib/usrp/mpmd/sim_find.cpp2
8 files changed, 34 insertions, 34 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_find.cpp b/host/lib/usrp/mpmd/mpmd_find.cpp
index 5d5aab1ba..97e6fab80 100644
--- a/host/lib/usrp/mpmd/mpmd_find.cpp
+++ b/host/lib/usrp/mpmd/mpmd_find.cpp
@@ -160,7 +160,7 @@ device_addrs_t mpmd_find_with_addrs(const device_addrs_t& hints)
UHD_LOG_TRACE("MPMD FIND", "Device responded: " << reply_addrs[0].to_string());
found_devices.push_back(reply_addrs[0]);
}
- if (found_devices.size() == 0) {
+ if (found_devices.empty()) {
return device_addrs_t();
} else if (found_devices.size() == 1) {
return found_devices;
diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp
index 5b19bcc00..a8d7909e0 100644
--- a/host/lib/usrp/mpmd/mpmd_impl.hpp
+++ b/host/lib/usrp/mpmd/mpmd_impl.hpp
@@ -222,12 +222,12 @@ public:
* Structors
************************************************************************/
mpmd_impl(const uhd::device_addr_t& device_addr);
- ~mpmd_impl();
+ ~mpmd_impl() override;
/**************************************************************************
* API
************************************************************************/
- uhd::rfnoc::mb_iface& get_mb_iface(const size_t mb_idx)
+ uhd::rfnoc::mb_iface& get_mb_iface(const size_t mb_idx) override
{
if (mb_idx >= _mb.size()) {
throw uhd::index_error(
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
index 56557bc39..dcb5d3473 100644
--- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
+++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.cpp
@@ -82,13 +82,12 @@ std::vector<std::string> get_addrs_from_mb_args(const uhd::device_addr_t& mb_arg
const mpmd_link_if_ctrl_udp::udp_link_info_map& link_info_list)
{
std::vector<std::string> addrs;
- if(link_info_list.size() > 0 &&
- link_info_list.begin()->second.link_type == "internal") {
+ if (!link_info_list.empty()
+ && link_info_list.begin()->second.link_type == "internal") {
// If link_type is "internal" we are local. In this case
// use this address always. MPM knows better than us.
addrs.push_back(link_info_list.begin()->first);
- }
- else {
+ } else {
if (mb_args.has_key(FIRST_ADDR_KEY)) {
addrs.push_back(mb_args[FIRST_ADDR_KEY]);
}
@@ -97,10 +96,9 @@ std::vector<std::string> get_addrs_from_mb_args(const uhd::device_addr_t& mb_arg
}
}
if(addrs.empty()) {
- if(link_info_list.size() > 0) {
+ if (!link_info_list.empty()) {
addrs.push_back(link_info_list.begin()->first);
- }
- else {
+ } else {
UHD_LOG_WARNING("MPMD::XPORT::UDP",
"The `" << FIRST_ADDR_KEY
<< "' key must be specified in "
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp
index 13d28e42b..876109aa4 100644
--- a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp
+++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_udp.hpp
@@ -36,16 +36,16 @@ public:
const mpmd_link_if_mgr::xport_info_list_t& xport_info,
const uhd::rfnoc::chdr_w_t chdr_w);
- size_t get_num_links() const;
+ size_t get_num_links() const override;
uhd::transport::both_links_t get_link(const size_t link_idx,
const uhd::transport::link_type_t link_type,
- const uhd::device_addr_t& link_args);
- size_t get_mtu(const uhd::direction_t) const
+ const uhd::device_addr_t& link_args) override;
+ size_t get_mtu(const uhd::direction_t) const override
{
return _mtu;
}
- double get_link_rate(const size_t link_idx) const;
- const uhd::rfnoc::chdr::chdr_packet_factory& get_packet_factory() const;
+ double get_link_rate(const size_t link_idx) const override;
+ const uhd::rfnoc::chdr::chdr_packet_factory& get_packet_factory() const override;
private:
const uhd::device_addr_t _mb_args;
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp
index 558570257..2b27e83cb 100644
--- a/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp
+++ b/host/lib/usrp/mpmd/mpmd_link_if_mgr.cpp
@@ -35,7 +35,7 @@ public:
*************************************************************************/
bool connect(const std::string& link_type,
const xport_info_list_t& xport_info,
- const uhd::rfnoc::chdr_w_t chdr_w)
+ const uhd::rfnoc::chdr_w_t chdr_w) override
{
auto link_if_ctrl = make_link_if_ctrl(link_type, xport_info, chdr_w);
if (!link_if_ctrl) {
@@ -57,14 +57,14 @@ public:
return true;
}
- size_t get_num_links()
+ size_t get_num_links() override
{
return _link_link_if_ctrl_map.size();
}
uhd::transport::both_links_t get_link(const size_t link_idx,
const uhd::transport::link_type_t link_type,
- const uhd::device_addr_t& link_args)
+ const uhd::device_addr_t& link_args) override
{
const size_t link_if_ctrl_idx = _link_link_if_ctrl_map.at(link_idx).first;
const size_t xport_link_idx = _link_link_if_ctrl_map.at(link_idx).second;
@@ -72,13 +72,13 @@ public:
->get_link(xport_link_idx, link_type, link_args);
}
- size_t get_mtu(const size_t link_idx, const uhd::direction_t dir) const
+ size_t get_mtu(const size_t link_idx, const uhd::direction_t dir) const override
{
return _link_if_ctrls.at(_link_link_if_ctrl_map.at(link_idx).first)->get_mtu(dir);
}
const uhd::rfnoc::chdr::chdr_packet_factory& get_packet_factory(
- const size_t link_idx) const
+ const size_t link_idx) const override
{
const size_t link_if_ctrl_idx = _link_link_if_ctrl_map.at(link_idx).first;
return _link_if_ctrls.at(link_if_ctrl_idx)->get_packet_factory();
diff --git a/host/lib/usrp/mpmd/mpmd_mb_iface.hpp b/host/lib/usrp/mpmd/mpmd_mb_iface.hpp
index 4e54cfc12..f1b7285ec 100644
--- a/host/lib/usrp/mpmd/mpmd_mb_iface.hpp
+++ b/host/lib/usrp/mpmd/mpmd_mb_iface.hpp
@@ -22,24 +22,26 @@ public:
using uptr = std::unique_ptr<mpmd_mb_iface>;
using clock_iface_list_t = std::vector<std::map<std::string, std::string>>;
mpmd_mb_iface(const uhd::device_addr_t& mb_args, uhd::rpc_client::sptr rpc);
- ~mpmd_mb_iface() = default;
+ ~mpmd_mb_iface() override = default;
/*** mpmd_mb_iface API calls *****************************************/
//! Initialize transports
void init();
/*** mb_iface API calls **********************************************/
- uint16_t get_proto_ver();
- uhd::rfnoc::chdr_w_t get_chdr_w();
- uhd::endianness_t get_endianness(const uhd::rfnoc::device_id_t local_device_id);
- uhd::rfnoc::device_id_t get_remote_device_id();
- std::vector<uhd::rfnoc::device_id_t> get_local_device_ids();
+ uint16_t get_proto_ver() override;
+ uhd::rfnoc::chdr_w_t get_chdr_w() override;
+ uhd::endianness_t get_endianness(
+ const uhd::rfnoc::device_id_t local_device_id) override;
+ uhd::rfnoc::device_id_t get_remote_device_id() override;
+ std::vector<uhd::rfnoc::device_id_t> get_local_device_ids() override;
uhd::transport::adapter_id_t get_adapter_id(
- const uhd::rfnoc::device_id_t local_device_id);
- void reset_network();
- uhd::rfnoc::clock_iface::sptr get_clock_iface(const std::string& clock_name);
+ const uhd::rfnoc::device_id_t local_device_id) override;
+ void reset_network() override;
+ uhd::rfnoc::clock_iface::sptr get_clock_iface(const std::string& clock_name) override;
uhd::rfnoc::chdr_ctrl_xport::sptr make_ctrl_transport(
- uhd::rfnoc::device_id_t local_device_id, const uhd::rfnoc::sep_id_t& local_epid);
+ uhd::rfnoc::device_id_t local_device_id,
+ const uhd::rfnoc::sep_id_t& local_epid) override;
uhd::rfnoc::chdr_rx_data_xport::uptr make_rx_data_transport(
uhd::rfnoc::mgmt::mgmt_portal& mgmt_portal,
const uhd::rfnoc::sep_addr_pair_t& addrs,
@@ -47,7 +49,7 @@ public:
const uhd::rfnoc::sw_buff_t pyld_buff_fmt,
const uhd::rfnoc::sw_buff_t mdata_buff_fmt,
const uhd::device_addr_t& xport_args,
- const std::string& streamer_id);
+ const std::string& streamer_id) override;
uhd::rfnoc::chdr_tx_data_xport::uptr make_tx_data_transport(
uhd::rfnoc::mgmt::mgmt_portal& mgmt_portal,
const uhd::rfnoc::sep_addr_pair_t& addrs,
@@ -55,7 +57,7 @@ public:
const uhd::rfnoc::sw_buff_t pyld_buff_fmt,
const uhd::rfnoc::sw_buff_t mdata_buff_fmt,
const uhd::device_addr_t& xport_args,
- const std::string& streamer_id);
+ const std::string& streamer_id) override;
private:
uhd::device_addr_t _mb_args;
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index ac620f3e0..6e67b4b7e 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -293,7 +293,7 @@ mpmd_mboard_impl::mpmd_mboard_impl(
UHD_LOG_DEBUG("MPMD", "MPM reports device info: " << device_info.to_string());
/// Get dboard info
const auto dboards_info = rpc->request<std::vector<dev_info>>("get_dboard_info");
- UHD_ASSERT_THROW(this->dboard_info.size() == 0);
+ UHD_ASSERT_THROW(this->dboard_info.empty());
for (const auto& dboard_info_dict : dboards_info) {
uhd::device_addr_t this_db_info;
for (const auto& info_pair : dboard_info_dict) {
diff --git a/host/lib/usrp/mpmd/sim_find.cpp b/host/lib/usrp/mpmd/sim_find.cpp
index 2f957977e..d41d8dc10 100644
--- a/host/lib/usrp/mpmd/sim_find.cpp
+++ b/host/lib/usrp/mpmd/sim_find.cpp
@@ -81,7 +81,7 @@ public:
{
}
- ~sim_impl()
+ ~sim_impl() override
{
// Destroys the mb_ifaces, causing mpm to be unclaimed before shutting down the
// simulator