Change in libosmo-abis[master]: lapd: don't add parenthesis around datalink name

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 17 20:19:08 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/26229 )

Change subject: lapd: don't add parenthesis around datalink name
......................................................................

lapd: don't add parenthesis around datalink name

The name [printing] works like this:

* libosmo-abis:lapd tells libosmogsm:lapd_core a name for each data link
* libosmgsm:lapd_core assumes this name has no paranthesis and puts additional
  parenthesis around it in macros like LOGDL

However, current libosmo-abis:lapd [before this patch] adds its own set
of parenthesis, causing all ISDN-LAPD related log messages generated by
libosmgsm:lapd_core to have double-parenthesis.

So we have to remove the parenthesis from lapd_datalink.name and
lapd_instance.name to fix the log lines printed in libosmocore.

This in turn means we have to add parenthesis to some log statements
here in libosmo-abis:lapd.

Why can't we instead modify libosmogsm:lapd_core to drop parenthesis
there? Becaus it is also used by LAPDm code in osmo-bts, and those two
get it right :)

Change-Id: I688cf2a73a8c31cb3cf66ec005d02a14de197008
Related: Ie6742843fff809edffcac24c4dce4edf66bc71be
Related: OS#1938
---
M src/input/lapd.c
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  tnt: Looks good to me, but someone else must approve
  dexter: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/input/lapd.c b/src/input/lapd.c
index d8c67e4..6f1e270 100644
--- a/src/input/lapd.c
+++ b/src/input/lapd.c
@@ -74,13 +74,13 @@
 #define LAPD_SET_K(n, o)  {n,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}
 
 #define LOGLI(li, level, fmt, args ...) \
-	LOGP(DLLAPD, level, "%s: " fmt, (li)->name, ## args)
+	LOGP(DLLAPD, level, "(%s): " fmt, (li)->name, ## args)
 
 #define LOGTEI(teip, level, fmt, args ...) \
 	LOGP(DLLAPD, level, "(%s-T%u): " fmt, (teip)->li->name, (teip)->tei, ## args)
 
 #define LOGSAP(sap, level, fmt, args ...) \
-	LOGP(DLLAPD, level, "%s: " fmt, (sap)->dl.name, ## args)
+	LOGP(DLLAPD, level, "(%s): " fmt, (sap)->dl.name, ## args)
 
 #define DLSAP_MSGB_SIZE		128
 #define DLSAP_MSGB_HEADROOM	56
@@ -240,14 +240,14 @@
 	char name[256];
 	int k;
 
-	snprintf(name, sizeof(name), "(%s-T%u-S%u)", li->name, teip->tei, sapi);
+	snprintf(name, sizeof(name), "%s-T%u-S%u", li->name, teip->tei, sapi);
 
 	sap = talloc_zero(teip, struct lapd_sap);
 	if (!sap)
 		return NULL;
 
 	LOGP(DLLAPD, LOGL_NOTICE,
-	     "%s: LAPD Allocating SAP for SAPI=%u / TEI=%u (dl=%p, sap=%p)\n",
+	     "(%s): LAPD Allocating SAP for SAPI=%u / TEI=%u (dl=%p, sap=%p)\n",
 	     name, sapi, teip->tei, &sap->dl, sap);
 
 	sap->sapi = sapi;
@@ -256,7 +256,7 @@
 	profile = &li->profile;
 
 	k = profile->k[sapi & 0x3f];
-	LOGP(DLLAPD, LOGL_NOTICE, "%s: k=%d N200=%d N201=%d T200=%d.%d T203=%d.%d\n",
+	LOGP(DLLAPD, LOGL_NOTICE, "(%s): k=%d N200=%d N201=%d T200=%d.%d T203=%d.%d\n",
 		name, k, profile->n200, profile->n201, profile->t200_sec,
 		profile->t200_usec, profile->t203_sec, profile->t203_usec);
 	lapd_dl_init2(dl, k, 128, profile->n201, name);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/26229
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I688cf2a73a8c31cb3cf66ec005d02a14de197008
Gerrit-Change-Number: 26229
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211117/07eec07b/attachment.htm>


More information about the gerrit-log mailing list