mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 05:23:43 +00:00
pcu_sock: get rid of magic numbers and use ARRAY_SIZE() for array iteration
Change-Id: I602b581fab67b3a1c3c03c73a3a99e9afd564e29
This commit is contained in:
@@ -211,7 +211,7 @@ static int pcu_tx_info_ind(struct gsm_bts *bts)
|
|||||||
info_ind->initial_mcs = rlcc->initial_mcs;
|
info_ind->initial_mcs = rlcc->initial_mcs;
|
||||||
|
|
||||||
/* NSVC */
|
/* NSVC */
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < ARRAY_SIZE(info_ind->nsvci); i++) {
|
||||||
nsvc = &bts->gprs.nsvc[i];
|
nsvc = &bts->gprs.nsvc[i];
|
||||||
info_ind->nsvci[i] = nsvc->nsvci;
|
info_ind->nsvci[i] = nsvc->nsvci;
|
||||||
info_ind->local_port[i] = nsvc->local_port;
|
info_ind->local_port[i] = nsvc->local_port;
|
||||||
@@ -219,13 +219,13 @@ static int pcu_tx_info_ind(struct gsm_bts *bts)
|
|||||||
info_ind->remote_ip[i] = nsvc->remote_ip;
|
info_ind->remote_ip[i] = nsvc->remote_ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < ARRAY_SIZE(info_ind->trx); i++) {
|
||||||
trx = gsm_bts_trx_num(bts, i);
|
trx = gsm_bts_trx_num(bts, i);
|
||||||
if (!trx)
|
if (!trx)
|
||||||
break;
|
break;
|
||||||
info_ind->trx[i].pdch_mask = 0;
|
info_ind->trx[i].pdch_mask = 0;
|
||||||
info_ind->trx[i].arfcn = trx->arfcn;
|
info_ind->trx[i].arfcn = trx->arfcn;
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < ARRAY_SIZE(trx->ts); j++) {
|
||||||
ts = &trx->ts[j];
|
ts = &trx->ts[j];
|
||||||
if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
|
if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
|
||||||
&& ts_should_be_pdch(ts)) {
|
&& ts_should_be_pdch(ts)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user