[PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability

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
Fri Jan 26 11:57:48 UTC 2018


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/4086

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

Simplify TS alloc: improve readability

* consistently format log messages to make it possible to grep for test
  output in source code
* remove dead code

Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb
Related: OS#2282
---
M src/gprs_rlcmac_ts_alloc.cpp
1 file changed, 6 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/4086/2

diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index c9c9d8f..b38a8ed 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -205,8 +205,7 @@
 				tfi = find_free_tfi(pdch, dir);
 				if (tfi < 0) {
 					LOGP(DRLCMAC, LOGL_DEBUG,
-						"- Skipping TS %d, because "
-						"no TFI available\n", ts);
+					     "- Skipping TS %d, because no TFI available\n", ts);
 					continue;
 				}
 			}
@@ -215,25 +214,22 @@
 				usf = find_free_usf(pdch);
 				if (usf < 0) {
 					LOGP(DRLCMAC, LOGL_DEBUG,
-						"- Skipping TS %d, because "
-						"no USF available\n", ts);
+					     "- Skipping TS %d, because no USF available\n", ts);
 					continue;
 				}
 			}
 			if (min_ts >= 0)
 				LOGP(DRLCMAC, LOGL_DEBUG,
-					"- Skipping TS %d, because "
-					"num TBFs %d > %d\n",
-					min_ts, min_used, num_tbfs);
+				     "- Skipping TS %d, because num TBFs %d > %d\n",
+				     min_ts, min_used, num_tbfs);
 			min_used = num_tbfs;
 			min_ts = ts;
 			min_tfi = tfi;
 			min_usf = usf;
 		} else {
 			LOGP(DRLCMAC, LOGL_DEBUG,
-				"- Skipping TS %d, because "
-				"num TBFs %d >= %d\n",
-				ts, num_tbfs, min_used);
+			     "- Skipping TS %d, because num TBFs %d >= %d\n",
+			     ts, num_tbfs, min_used);
 		}
 	}
 
@@ -715,19 +711,6 @@
 
 		/* Compute capacity */
 		capacity = compute_capacity(trx, rx_window, tx_window);
-
-#ifdef ENABLE_TS_ALLOC_DEBUG
-		LOGP(DRLCMAC, LOGL_DEBUG,
-			"- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), "
-			"capacity = %d\n",
-			set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars(
-					slot_info,
-					rx_bad, 'x', '.'),
-					rx_window, 'D'),
-					tx_window, 'U'),
-					rx_window & tx_window, 'C'),
-			capacity);
-#endif
 
 		if (capacity <= max_capacity)
 			continue;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list