cosmetic: clarify coding scheme and puncturing

* use appropriate types for coding scheme parameters
* add comment regarding possible number of RLCMAC blocks

The code in create_dl_acked_block() has underlying assumption that
rlc.num_data_blocks can never be more than 2, which is true and is
enforced by appropriate asserts but is not obvious when looking at the
function code alone. It's equally hard for Coverity which leads to false
positives in scan.

Lets' make this assumption explicit by putting it into for(;;) condition
alongside with corresponding comment.

Fixes: CID143070
Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 58b55dc..b871bc3 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -666,7 +666,7 @@
 	unsigned msg_len;
 	bool need_poll;
 	/* TODO: support MCS-7 - MCS-9, where data_block_idx can be 1 */
-	unsigned int data_block_idx = 0;
+	uint8_t data_block_idx = 0;
 	unsigned int rrbp;
 	uint32_t new_poll_fn;
 	int rc;
@@ -752,8 +752,8 @@
 
 	LOGP(DRLCMACDL, LOGL_DEBUG, "- Copying %u RLC blocks, %u BSNs\n", rlc.num_data_blocks, num_bsns);
 
-	/* Copy block(s) to RLC message */
-	for (data_block_idx = 0; data_block_idx < rlc.num_data_blocks;
+	/* Copy block(s) to RLC message: the num_data_blocks cannot be more than 2 - see assert above */
+	for (data_block_idx = 0; data_block_idx < OSMO_MIN(rlc.num_data_blocks, 2);
 		data_block_idx++)
 	{
 		int bsn;
@@ -777,7 +777,7 @@
 			OSMO_ASSERT(m_rlc.block(bsn)->next_ps >= EGPRS_PS_1);
 			OSMO_ASSERT(m_rlc.block(bsn)->next_ps <= EGPRS_PS_3);
 		}
-		OSMO_ASSERT(data_block_idx < 2); /* punct defined above as 2-element array */
+
 		punct[data_block_idx] = m_rlc.block(bsn)->next_ps;
 
 		rdbi = &rlc.block_info[data_block_idx];