Change in ...osmo-trx[master]: Transceiver: Simplify code on early error return when calling detectA...

pespin gerrit-no-reply at lists.osmocom.org
Sun Jul 7 14:48:32 UTC 2019


pespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-trx/+/14662 )

Change subject: Transceiver: Simplify code on early error return when calling detectAnyBurst
......................................................................

Transceiver: Simplify code on early error return when calling detectAnyBurst

We get rid of one branch and simplify code logic.

Change-Id: I026e35262bfe42c3d23ebdc06d84e4908a8380e2
---
M Transceiver52M/Transceiver.cpp
1 file changed, 4 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 7f05a2c..81b428a 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -650,20 +650,16 @@
 
   /* Detect normal or RACH bursts */
   rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa, max_toa);
-
-  if (rc > 0) {
-    type = (CorrType) rc;
-  } else if (rc <= 0) {
-    if (rc == -SIGERR_CLIP) {
+  if (rc <= 0) {
+    if (rc == -SIGERR_CLIP)
       LOG(WARNING) << "Clipping detected on received RACH or Normal Burst";
-    } else if (rc != SIGERR_NONE) {
+    else if (rc != SIGERR_NONE)
       LOG(WARNING) << "Unhandled RACH or Normal Burst detection error";
-    }
-
     delete radio_burst;
     return false;
   }
 
+  type = (CorrType) rc;
   bi->toa = toa;
   rxBurst = demodAnyBurst(*burst, mSPSRx, amp, toa, type);
 

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I026e35262bfe42c3d23ebdc06d84e4908a8380e2
Gerrit-Change-Number: 14662
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190707/c1807654/attachment.html>


More information about the gerrit-log mailing list