diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-10-21 12:21:57 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-10-21 12:19:56 +0000 |
commit | 7f2e8512ccf272708eb7cb8f69466011a084490f (patch) | |
tree | 5d50e910c0ab4ddff904a7262c564b134cb517d7 | |
parent | a52eed1d16d18fc577e6721974102c4614cdd44d (diff) |
acc_ramp: An unsigned int is always >= 0
Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
-rw-r--r-- | src/osmo-bsc/acc_ramp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/osmo-bsc/acc_ramp.c b/src/osmo-bsc/acc_ramp.c index ac9f02da1..bc2e3fb73 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 bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc) 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 allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc) 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); |