From b8734baa23000754b407f829349e11d7bcc00e40 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 12 Jun 2019 15:50:57 +0700 Subject: protocol/gsm_04_08.h: do not check if unsigned is positive Change-Id: I6b486b52a3733d5fd5e8ba18acbc9374e2e8bd7e --- include/osmocom/gsm/protocol/gsm_04_08.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 16910c35..2be6ed34 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -719,7 +719,7 @@ struct gsm48_rach_control { */ static inline void gsm48_barr_acc(struct gsm48_rach_control *rach_control, unsigned int acc) { - OSMO_ASSERT(acc >= 0 && acc <= 15); + OSMO_ASSERT(acc <= 15); if (acc >= 8) rach_control->t2 |= (1 << (acc - 8)); else @@ -733,7 +733,7 @@ static inline void gsm48_barr_acc(struct gsm48_rach_control *rach_control, unsig */ static inline void gsm48_allow_acc(struct gsm48_rach_control *rach_control, unsigned int acc) { - OSMO_ASSERT(acc >= 0 && acc <= 15); + OSMO_ASSERT(acc <= 15); if (acc >= 8) rach_control->t2 &= ~(1 << (acc - 8)); else @@ -748,7 +748,7 @@ static inline void gsm48_allow_acc(struct gsm48_rach_control *rach_control, unsi */ static inline bool gsm48_acc_is_barred(struct gsm48_rach_control *rach_control, unsigned int acc) { - OSMO_ASSERT(acc >= 0 && acc <= 15); + OSMO_ASSERT(acc <= 15); if (acc >= 8) return (rach_control->t2 & (1 << (acc - 8))) != 0; return (rach_control->t3 & (1 << (acc))) != 0; -- cgit v1.2.3