gsm: Revert the gsm_7bit_encode changes as they are wrong

This reverts commit f996b05dbddccb8e8788dd69777a4fedfa2373eb
and 2b0cac4ef83137ee0bdd583aee877eac467abeab. A detailed
explanation can be found here:

  http://lists.osmocom.org/pipermail/openbsc/2013-July/004737.html

The short description is that:

1.) The API should return (as out parameter) the number of
    octets used.
2.) The handling for the <CR> encoding only applies to USSD
    and it is incomplete. On top of that it broke the SMS test.
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 89d43c8..b9b3ed9 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -85,7 +85,7 @@
 {
 	struct msgb *msg;
 	uint8_t *seq_len_ptr, *ussd_len_ptr, *data;
-	int len, octet_len;
+	int len;
 
 	msg = msgb_alloc_headroom(1024, 128, "GSM 04.80");
 	if (!msg)
@@ -106,13 +106,8 @@
 	ussd_len_ptr = msgb_put(msg, 1);
 	data = msgb_put(msg, 0);
 	len = gsm_7bit_encode(data, text);
-	octet_len = len*7/8;
-	if (len*7%8 != 0)
-		octet_len++;
-	/* Warning, len indicates the amount of septets
-	 * (characters), we need amount of octets occupied */
-	msgb_put(msg, octet_len);
-	ussd_len_ptr[0] = octet_len;
+	msgb_put(msg, len);
+	ussd_len_ptr[0] = len;
 	/* USSD-String } */
 
 	/* alertingPattern { */
@@ -132,7 +127,7 @@
 	struct msgb *msg;
 	uint8_t *data, *tmp_len;
 	uint8_t *seq_len_ptr, *cal_len_ptr, *opt_len_ptr, *nam_len_ptr;
-	int len, octet_len;
+	int len;
 
 	len = strlen(text);
 	if (len < 1 || len > 160)
@@ -178,17 +173,12 @@
 	tmp_len = msgb_put(msg, 1);
 	data = msgb_put(msg, 0);
 	len = gsm_7bit_encode(data, text);
-	octet_len = len*7/8;
-	if (len*7%8 != 0)
-		octet_len++;
-	/* Warning, len indicates the amount of septets
-	 * (characters), we need amount of octets occupied */
-	tmp_len[0] = octet_len;
-	msgb_put(msg, octet_len);
+	tmp_len[0] = len;
+	msgb_put(msg, len);
 
 	/* }; namePresentationAllowed */
 
-	cal_len_ptr[0] = 3 + 3 + 2 + octet_len;
+	cal_len_ptr[0] = 3 + 3 + 2 + len;
 	opt_len_ptr[0] = cal_len_ptr[0] + 2;
 	/* }; callingName */
 
@@ -425,7 +415,7 @@
 	struct msgb *msg;
 	struct gsm48_hdr *gh;
 	uint8_t *ptr8;
-	int response_len, octet_len;
+	int response_len;
 
 	msg = msgb_alloc_headroom(1024, 128, "GSM 04.80");
 	if (!msg)
@@ -434,12 +424,7 @@
 	/* First put the payload text into the message */
 	ptr8 = msgb_put(msg, 0);
 	response_len = gsm_7bit_encode(ptr8, text);
-	octet_len = response_len*7/8;
-	if (response_len*7%8 != 0)
-		octet_len++;
-	/* Warning, response_len indicates the amount of septets
-	 * (characters), we need amount of octets occupied */
-	msgb_put(msg, octet_len);
+	msgb_put(msg, response_len);
 
 	/* Then wrap it as an Octet String */
 	msgb_wrap_with_TL(msg, ASN1_OCTET_STRING_TAG);