Return void in tbf_assign_control_ts()

This operation cannot fail, hence let's simplify code.

Change-Id: I5675df4b6309d680d1d5e2dbea87991468f30630
This commit is contained in:
Pau Espin 2021-10-12 19:36:40 +02:00
parent ffe998ce9d
commit 32744c8916
2 changed files with 4 additions and 11 deletions

View File

@ -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);

View File

@ -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);