aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-15 17:23:34 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-16 14:03:43 +0200
commitcd40fb4dea46cc82acf94f1e671aba2f3f5997cf (patch)
tree53ee2cec1988d13b2c7238da457003a7a7f7659b
parent779a72819dd0242a906acd776367f5622b7a8e79 (diff)
vty: Cosmetic change to the writing of the bts->model
Based on the feedback of Peter from the mailinglist, move the writing code to a new method and return early if there is no bts->model.
-rw-r--r--openbsc/src/libbsc/bsc_vty.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 3fb8516ab..2cbcf44c8 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -460,9 +460,23 @@ static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts)
}
}
-static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
+/* Write the model data if there is one */
+static void config_write_bts_model(struct vty *vty, struct gsm_bts *bts)
{
struct gsm_bts_trx *trx;
+
+ if (!bts->model)
+ return;
+
+ if (bts->model->config_write_bts)
+ bts->model->config_write_bts(vty, bts);
+
+ llist_for_each_entry(trx, &bts->trx_list, list)
+ config_write_trx_single(vty, trx);
+}
+
+static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
+{
int i;
vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE);
@@ -602,13 +616,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
if (bts->excl_from_rf_lock)
vty_out(vty, " rf-lock-exclude%s", VTY_NEWLINE);
- if (bts->model) {
- if (bts->model->config_write_bts)
- bts->model->config_write_bts(vty, bts);
-
- llist_for_each_entry(trx, &bts->trx_list, list)
- config_write_trx_single(vty, trx);
- }
+ config_write_bts_model(vty, bts);
}
static int config_write_bts(struct vty *v)