Feedback on l1sap-parts

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/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Thu Jan 16 10:25:52 UTC 2014


Dear Andreas,

I noticed you rebased the code and I have further comments and requests
for general changes.


Magic Numbers:
Please avoid magic numbers where you can. There is no runtime overhead
by using a define and little pre-processing overhead.

E.g. in here
#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == 0x40)


Make your methods smaller:
Please compare this with the work Daniel and me to in cleaning up your
code in the osmo-pcu. By splitting up the alloc_algorithm_b code we
started to notice various defects just by looking at the code.


Remove copy and paste:
I think I saw the msgb in-place changing in at least two places. Avoid
copy and paste (code cloning).


Avoid putting logic in deeply nested constructs:

	if (a)
		if (b)
			if (c)
				important_stuff


kind regards
	holger




More information about the OpenBSC mailing list