diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-10-12 19:36:40 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-10-12 19:36:49 +0200 |
commit | 32744c8916ade6e6fb571113ae0ce74c2c45f007 (patch) | |
tree | b9b3338d9e2f3cb1773bb3e32603d0b093f0d9df | |
parent | ffe998ce9d0437d44f7ba129d30b5bdc39139af4 (diff) |
Return void in tbf_assign_control_ts()
This operation cannot fail, hence let's simplify code.
Change-Id: I5675df4b6309d680d1d5e2dbea87991468f30630
-rw-r--r-- | src/tbf.cpp | 13 | ||||
-rw-r--r-- | src/tbf.h | 2 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 153ba809..af15c725 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -326,7 +326,7 @@ int gprs_rlcmac_tbf::update() return 0; } -int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf) +void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf) { if (tbf->control_ts == TBF_CONTROL_TS_UNSET) LOGPTBF(tbf, LOGL_INFO, "Setting Control TS %d\n", @@ -335,8 +335,6 @@ int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf) LOGPTBF(tbf, LOGL_INFO, "Changing Control TS %d -> %d\n", tbf->control_ts, tbf->first_common_ts); tbf->control_ts = tbf->first_common_ts; - - return 0; } void gprs_rlcmac_tbf::n_reset(enum tbf_counters n) @@ -660,13 +658,8 @@ int gprs_rlcmac_tbf::setup(int8_t use_trx, bool single_slot) bts_do_rate_ctr_inc(bts, CTR_TBF_ALLOC_FAIL); return -1; } - /* assign control ts */ - rc = tbf_assign_control_ts(this); - /* if no resource */ - if (rc < 0) { - LOGPTBF(this, LOGL_ERROR, "Failed to assign control TS\n"); - return -1; - } + /* assign initial control ts */ + tbf_assign_control_ts(this); /* set timestamp */ osmo_clock_gettime(CLOCK_MONOTONIC, &meas.rssi_tv); @@ -142,7 +142,7 @@ uint8_t tbf_ul_slots(const struct gprs_rlcmac_tbf *tbf); bool tbf_is_tfi_assigned(const struct gprs_rlcmac_tbf *tbf); uint8_t tbf_tfi(const struct gprs_rlcmac_tbf *tbf); bool tbf_is_egprs_enabled(const struct gprs_rlcmac_tbf *tbf); -int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); +void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t); void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); |