[PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Wed Jan 31 10:10:57 UTC 2018


Hello Harald Welte, Jenkins Builder, Holger Freyther,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3929

to look at the new patch set (#9).

Simplify TS alloc: replace debug printer

Replace unreadable recursive debug printer with simpler functions.

Note: the new printer also correctly handle reserved TS so Control slot
overrides TS for the bits set for both Uplink and Downlink slots. This
does not change the allocation semantics of course but requires cosmetic
adjustement to TBF tests output.

Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb
Related: OS#2282
---
M src/gprs_rlcmac_ts_alloc.cpp
1 file changed, 3 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/9

diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 707aca5..5cebed4 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -36,20 +36,6 @@
 /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */
 #define PDCH_IDLE_TBF_THRESH	1
 
-static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0)
-{
-	int i;
-
-	for (i = 0; i < 8; i += 1, val = val >> 1) {
-		if (val & 1)
-			buf[i] = set_char;
-		else if (unset_char)
-			buf[i] = unset_char;
-	}
-
-	return buf;
-}
-
 static inline void masked_override_with(char *buf, uint8_t mask, char set_char)
 {
 	int i;
@@ -588,11 +574,9 @@
 	*dl_slots &= pdch_slots;
 	*ul_slots &= pdch_slots;
 
-	LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n",
-		set_flag_chars(set_flag_chars(set_flag_chars(slot_info,
-				*dl_slots, 'D', '.'),
-				*ul_slots, 'U'),
-				*ul_slots & *dl_slots, 'C'));
+	ts_format(slot_info, *dl_slots, *ul_slots);
+	LOGP(DRLCMAC, LOGL_DEBUG,
+	     "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info);
 
 	/* Check for each UL (TX) slot */
 

-- 
To view, visit https://gerrit.osmocom.org/3929
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb
Gerrit-PatchSet: 9
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list