Change in osmocom-bb[master]: trxcon: use osmo_{store, load}32be() to pack / unpack TDMA fn

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

fixeria gerrit-no-reply at lists.osmocom.org
Sun Jun 14 11:30:57 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/18823 )

Change subject: trxcon: use osmo_{store,load}32be() to pack / unpack TDMA fn
......................................................................

trxcon: use osmo_{store,load}32be() to pack / unpack TDMA fn

Change-Id: I9eff9b8e4b8ce9e0563a1ec3c485ab8b0f306491
---
M src/host/trxcon/trx_if.c
1 file changed, 2 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, approved



diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 91f84ec..7a736a8 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -592,7 +592,7 @@
 	}
 
 	tn = buf[0];
-	fn = (buf[1] << 24) | (buf[2] << 16) | (buf[3] << 8) | buf[4];
+	fn = osmo_load32be(buf + 1);
 	rssi = -(int8_t) buf[5];
 	toa256 = ((int16_t) (buf[6] << 8) | buf[7]);
 
@@ -650,10 +650,7 @@
 	LOGP(DTRXD, LOGL_DEBUG, "TX burst tn=%u fn=%u pwr=%u\n", tn, fn, pwr);
 
 	buf[0] = tn;
-	buf[1] = (fn >> 24) & 0xff;
-	buf[2] = (fn >> 16) & 0xff;
-	buf[3] = (fn >>  8) & 0xff;
-	buf[4] = (fn >>  0) & 0xff;
+	osmo_store32be(fn, buf + 1);
 	buf[5] = pwr;
 
 	/* Copy ubits {0,1} */

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I9eff9b8e4b8ce9e0563a1ec3c485ab8b0f306491
Gerrit-Change-Number: 18823
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200614/ceee9f33/attachment.htm>


More information about the gerrit-log mailing list