[PATCH] osmo-trx[master]: Transceiver: Remove unsigned negative compares

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

Tom Tsou gerrit-no-reply at lists.osmocom.org
Fri Mar 31 02:40:51 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2188

to look at the new patch set (#2).

Transceiver: Remove unsigned negative compares

Change-Id: I49f30699786c52736ef334dae61f7bbd65d878d5
Fixes: Coverity CID 149353, 149356
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/osmo-trx.cpp
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/88/2188/2

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 4616fea..66eff7f 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -788,9 +788,9 @@
     // set TSC
     unsigned TSC;
     sscanf(buffer, "%3s %s %d", cmdcheck, command, &TSC);
-    if ((TSC < 0) || (TSC > 7))
+    if (TSC > 7) {
       sprintf(response, "RSP SETTSC 1 %d", TSC);
-    else {
+    } else {
       LOG(NOTICE) << "Changing TSC from " << mTSC << " to " << TSC;
       mTSC = TSC;
       sprintf(response,"RSP SETTSC 0 %d", TSC);
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 5e81586..b36c081 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -168,7 +168,7 @@
 	if (!config->chans)
 		config->chans = DEFAULT_CHANS;
 
-	if (config->mcbts && ((config->chans < 0) || (config->chans > 5))) {
+	if (config->mcbts && config->chans > 5) {
 		std::cout << "Unsupported number of channels" << std::endl;
 		return false;
 	}

-- 
To view, visit https://gerrit.osmocom.org/2188
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I49f30699786c52736ef334dae61f7bbd65d878d5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou <tom at tsou.cc>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list