From 5bdc6031136916b7061db208397c66e83a5a55a4 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 3 Mar 2020 17:38:16 +0000 Subject: [PATCH] added error macros --- srsenb/src/stack/mac/scheduler.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/srsenb/src/stack/mac/scheduler.cc b/srsenb/src/stack/mac/scheduler.cc index f0684cadc..b748c94a4 100644 --- a/srsenb/src/stack/mac/scheduler.cc +++ b/srsenb/src/stack/mac/scheduler.cc @@ -207,20 +207,19 @@ int sched::ue_cfg(uint16_t rnti, const sched_interface::ue_cfg_t& ue_cfg) } it->second.set_cfg(ue_cfg); - return 0; + return SRSLTE_SUCCESS; } int sched::ue_rem(uint16_t rnti) { std::lock_guard lock(sched_mutex); - int ret = 0; if (ue_db.count(rnti) > 0) { ue_db.erase(rnti); } else { Error("User rnti=0x%x not found\n", rnti); - ret = -1; + return SRSLTE_ERROR; } - return ret; + return SRSLTE_SUCCESS; } bool sched::ue_exists(uint16_t rnti) @@ -448,16 +447,15 @@ void sched::generate_cce_location(srslte_regs_t* regs_, template int sched::ue_db_access(uint16_t rnti, Func f) { - int ret = 0; std::lock_guard lock(sched_mutex); auto it = ue_db.find(rnti); if (it != ue_db.end()) { f(it->second); } else { Error("User rnti=0x%x not found\n", rnti); - ret = -1; + return SRSLTE_ERROR; } - return ret; + return SRSLTE_SUCCESS; } } // namespace srsenb