laforge has uploaded this change for review.

View Change

Try to work around coverity false positives in macros

we have some macros that may at times have signed arguments, and at
other times unsigned. Checking for <= 0 is not a bug in this case.

Change-Id: I10e60b20c6f8092cf1ce09ebe501e739fd4a9479
Related: CID#272993, CID#272992 (and many others)
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/31118/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 44a9d5e..5d52f9b 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -495,8 +495,10 @@
*
* These macros convert from n to the other representations:
*/
+// coverity[unsigned_compare:FALSE]
#define ALG_A5_NR_TO_RSL(A5_N) ((A5_N) >= 0 ? (A5_N)+1 : 0)
#define ALG_A5_NR_TO_BSSAP(A5_N) ALG_A5_NR_TO_RSL(A5_N)
+// coverity[unsigned_compare:FALSE]
#define ALG_A5_NR_TO_PERM_ALG_BITS(A5_N) ((A5_N) >= 0 ? 1<<(A5_N) : 0)

/* Up to 16 SI2quater are multiplexed; each fits 3 EARFCNS, so the practical maximum is 3*16.

To view, visit change 31118. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I10e60b20c6f8092cf1ce09ebe501e739fd4a9479
Gerrit-Change-Number: 31118
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-MessageType: newchange