Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11408 )

Change subject: acc_ramp: An unsigned int is always >= 0
..

acc_ramp: An unsigned int is always >= 0

Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
---
M src/osmo-bsc/acc_ramp.c
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/acc_ramp.c b/src/osmo-bsc/acc_ramp.c
index ac9f02d..bc2e3fb 100644
--- a/src/osmo-bsc/acc_ramp.c
+++ b/src/osmo-bsc/acc_ramp.c
@@ -36,7 +36,7 @@
  */
 static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc == 8 || acc == 9)
return (bts->si_common.rach_control.t2 & (1 << (acc - 8)));
return (bts->si_common.rach_control.t3 & (1 << (acc)));
@@ -44,7 +44,7 @@

 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc_ramp->barred_accs & (1 << acc))
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: allowing Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs &= ~(1 << acc);
@@ -52,7 +52,7 @@

 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if ((acc_ramp->barred_accs & (1 << acc)) == 0)
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: barring Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs |= (1 << acc);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11408 )

Change subject: acc_ramp: An unsigned int is always >= 0
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11408


Change subject: acc_ramp: An unsigned int is always >= 0
..

acc_ramp: An unsigned int is always >= 0

Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
---
M src/osmo-bsc/acc_ramp.c
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/11408/1

diff --git a/src/osmo-bsc/acc_ramp.c b/src/osmo-bsc/acc_ramp.c
index ac9f02d..bc2e3fb 100644
--- a/src/osmo-bsc/acc_ramp.c
+++ b/src/osmo-bsc/acc_ramp.c
@@ -36,7 +36,7 @@
  */
 static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc == 8 || acc == 9)
return (bts->si_common.rach_control.t2 & (1 << (acc - 8)));
return (bts->si_common.rach_control.t3 & (1 << (acc)));
@@ -44,7 +44,7 @@

 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc_ramp->barred_accs & (1 << acc))
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: allowing Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs &= ~(1 << acc);
@@ -52,7 +52,7 @@

 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if ((acc_ramp->barred_accs & (1 << acc)) == 0)
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: barring Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs |= (1 << acc);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte