aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-17 18:39:36 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-02-24 15:18:21 +0100
commit735da0376d0fea6dee12875948cf01bd4b8bfbd5 (patch)
treed6511089ec84eae0f4ec43c03415e9c7c5872098
parentaf12ca5431c4810d1ce4f0dc6fa995c9d5398ed0 (diff)
pcu_sock: get rid of magic numbers and use ARRAY_SIZE() for array iteration
-rw-r--r--openbsc/src/libbsc/pcu_sock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index da3505b21..e9bf5c810 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -211,7 +211,7 @@ static int pcu_tx_info_ind(struct gsm_bts *bts)
info_ind->initial_mcs = rlcc->initial_mcs;
/* NSVC */
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < ARRAY_SIZE(info_ind->nsvci); i++) {
nsvc = &bts->gprs.nsvc[i];
info_ind->nsvci[i] = nsvc->nsvci;
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;
}
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < ARRAY_SIZE(info_ind->trx); i++) {
trx = gsm_bts_trx_num(bts, i);
if (!trx)
break;
info_ind->trx[i].pdch_mask = 0;
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];
if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
&& ts_should_be_pdch(ts)) {