meas rep logging: use log_check_level() to skip a logging loop

A side effect is that the final cleanup part of that function is now
always called, also when num_cell == 7.

(Whether we should really clear that logging context at that place is a
different question, out of scope here.)

Change-Id: I71a402a0940857bbedbaf25d293429934706a83c
This commit is contained in:
Neels Hofmeyr 2021-05-26 22:57:34 +02:00 committed by laforge
parent c1429f9cab
commit 245465662e
1 changed files with 7 additions and 6 deletions

View File

@ -1088,12 +1088,13 @@ static void print_meas_rep(struct gsm_lchan *lchan, struct gsm_meas_rep *mr)
DEBUGP(DMEAS, "%s\n", print_meas_rep_c(OTC_SELECT, lchan, mr));
if (mr->num_cell == 7)
return;
for (i = 0; i < mr->num_cell; i++) {
struct gsm_meas_rep_cell *mrc = &mr->cell[i];
DEBUGP(DMEAS, "IDX=%u ARFCN=%u BSIC=%u => %d dBm\n",
mrc->neigh_idx, mrc->arfcn, mrc->bsic, rxlev2dbm(mrc->rxlev));
if (mr->num_cell != 7
&& log_check_level(DMEAS, LOGL_DEBUG)) {
for (i = 0; i < mr->num_cell; i++) {
struct gsm_meas_rep_cell *mrc = &mr->cell[i];
DEBUGP(DMEAS, "IDX=%u ARFCN=%u BSIC=%u => %d dBm\n",
mrc->neigh_idx, mrc->arfcn, mrc->bsic, rxlev2dbm(mrc->rxlev));
}
}
if (bsub)